chore(xo-server/backups-ng): rm unneeded defer decorators
This commit is contained in:
parent
b3d8ce2041
commit
2ac1093543
@ -136,7 +136,7 @@ const listReplicatedVms = (
|
|||||||
xapi: Xapi,
|
xapi: Xapi,
|
||||||
scheduleId: string,
|
scheduleId: string,
|
||||||
srId: string,
|
srId: string,
|
||||||
vmUuid?: string,
|
vmUuid?: string
|
||||||
): Vm[] => {
|
): Vm[] => {
|
||||||
const { all } = xapi.objects
|
const { all } = xapi.objects
|
||||||
const vms = {}
|
const vms = {}
|
||||||
@ -147,11 +147,9 @@ const listReplicatedVms = (
|
|||||||
object.$type === 'vm' &&
|
object.$type === 'vm' &&
|
||||||
oc['xo:backup:schedule'] === scheduleId &&
|
oc['xo:backup:schedule'] === scheduleId &&
|
||||||
oc['xo:backup:sr'] === srId &&
|
oc['xo:backup:sr'] === srId &&
|
||||||
(
|
(oc['xo:backup:vm'] === vmUuid ||
|
||||||
oc['xo:backup:vm'] === vmUuid ||
|
|
||||||
// 2018-03-28, JFT: to catch VMs replicated before this fix
|
// 2018-03-28, JFT: to catch VMs replicated before this fix
|
||||||
oc['xo:backup:vm'] === undefined
|
oc['xo:backup:vm'] === undefined)
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
vms[object.$id] = object
|
vms[object.$id] = object
|
||||||
}
|
}
|
||||||
@ -716,8 +714,7 @@ export default class BackupNg {
|
|||||||
const errors = []
|
const errors = []
|
||||||
await waitAll(
|
await waitAll(
|
||||||
[
|
[
|
||||||
...remotes.map(
|
...remotes.map(async remoteId => {
|
||||||
defer(async ($defer, remoteId) => {
|
|
||||||
const fork = xva.pipe(new PassThrough())
|
const fork = xva.pipe(new PassThrough())
|
||||||
|
|
||||||
const handler = await app.getRemoteHandler(remoteId)
|
const handler = await app.getRemoteHandler(remoteId)
|
||||||
@ -743,10 +740,8 @@ export default class BackupNg {
|
|||||||
if (!deleteFirst) {
|
if (!deleteFirst) {
|
||||||
await this._deleteFullVmBackups(handler, oldBackups)
|
await this._deleteFullVmBackups(handler, oldBackups)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
),
|
...srs.map(async srId => {
|
||||||
...srs.map(
|
|
||||||
defer(async ($defer, srId) => {
|
|
||||||
const fork = xva.pipe(new PassThrough())
|
const fork = xva.pipe(new PassThrough())
|
||||||
fork.task = exportTask
|
fork.task = exportTask
|
||||||
|
|
||||||
@ -787,8 +782,7 @@ export default class BackupNg {
|
|||||||
if (!deleteFirst) {
|
if (!deleteFirst) {
|
||||||
await this._deleteVms(xapi, oldVms)
|
await this._deleteVms(xapi, oldVms)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
error => {
|
error => {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
@ -898,8 +892,7 @@ export default class BackupNg {
|
|||||||
const errors = []
|
const errors = []
|
||||||
await waitAll(
|
await waitAll(
|
||||||
[
|
[
|
||||||
...remotes.map(
|
...remotes.map(async remoteId => {
|
||||||
defer(async ($defer, remoteId) => {
|
|
||||||
const fork = forkExport()
|
const fork = forkExport()
|
||||||
|
|
||||||
const handler = await app.getRemoteHandler(remoteId)
|
const handler = await app.getRemoteHandler(remoteId)
|
||||||
@ -934,16 +927,11 @@ export default class BackupNg {
|
|||||||
parentPath = `${vdiDir}/${parent}`
|
parentPath = `${vdiDir}/${parent}`
|
||||||
}
|
}
|
||||||
|
|
||||||
await writeStream(
|
await writeStream(fork.streams[`${id}.vhd`](), handler, path, {
|
||||||
fork.streams[`${id}.vhd`](),
|
|
||||||
handler,
|
|
||||||
path,
|
|
||||||
{
|
|
||||||
// no checksum for VHDs, because they will be invalidated by
|
// no checksum for VHDs, because they will be invalidated by
|
||||||
// merges and chainings
|
// merges and chainings
|
||||||
checksum: false,
|
checksum: false,
|
||||||
}
|
})
|
||||||
)
|
|
||||||
$defer.onFailure.call(handler, 'unlink', path)
|
$defer.onFailure.call(handler, 'unlink', path)
|
||||||
|
|
||||||
if (isDelta) {
|
if (isDelta) {
|
||||||
@ -957,10 +945,8 @@ export default class BackupNg {
|
|||||||
if (!deleteFirst) {
|
if (!deleteFirst) {
|
||||||
this._deleteDeltaVmBackups(handler, oldBackups)
|
this._deleteDeltaVmBackups(handler, oldBackups)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
),
|
...srs.map(async srId => {
|
||||||
...srs.map(
|
|
||||||
defer(async ($defer, srId) => {
|
|
||||||
const fork = forkExport()
|
const fork = forkExport()
|
||||||
|
|
||||||
const xapi = app.getXapi(srId)
|
const xapi = app.getXapi(srId)
|
||||||
@ -1002,8 +988,7 @@ export default class BackupNg {
|
|||||||
if (!deleteFirst) {
|
if (!deleteFirst) {
|
||||||
await this._deleteVms(xapi, oldVms)
|
await this._deleteVms(xapi, oldVms)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
error => {
|
error => {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
|
Loading…
Reference in New Issue
Block a user