fix(backups/cleanVm): dont fail on broken metadata
This commit is contained in:
@@ -232,7 +232,15 @@ exports.cleanVm = async function cleanVm(
|
||||
// compile the list of unused XVAs and VHDs, and remove backup metadata which
|
||||
// reference a missing XVA/VHD
|
||||
await asyncMap(jsons, async json => {
|
||||
const metadata = JSON.parse(await handler.readFile(json))
|
||||
let metadata
|
||||
try {
|
||||
metadata = JSON.parse(await handler.readFile(json))
|
||||
} catch (error) {
|
||||
onLog(`failed to read metadata file ${json}`, { error })
|
||||
jsons.delete(json)
|
||||
return
|
||||
}
|
||||
|
||||
const { mode } = metadata
|
||||
let size
|
||||
if (mode === 'full') {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
||||
|
||||
- @xen-orchestra/fs patch
|
||||
- @xen-orchestra/backups patch
|
||||
- @xen-orchestra/proxy patch
|
||||
- vhd-lib minor
|
||||
- xo-server patch
|
||||
|
||||
Reference in New Issue
Block a user