fix(@xen-orchestra/backups): missing targets no longer prevent runs (#5651)
Fixes #5353
This commit is contained in:
parent
9601ad13ee
commit
d282d8dd52
@ -197,9 +197,43 @@ exports.Backup = class Backup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await using(
|
await using(
|
||||||
Disposable.all(extractIdsFromSimplePattern(job.srs).map(_ => this._getRecord('SR', _))),
|
Disposable.all(
|
||||||
Disposable.all(extractIdsFromSimplePattern(job.remotes).map(id => this._getAdapter(id))),
|
extractIdsFromSimplePattern(job.srs).map(id =>
|
||||||
|
this._getRecord('SR', id).catch(error => {
|
||||||
|
runTask(
|
||||||
|
{
|
||||||
|
name: 'get SR record',
|
||||||
|
data: { type: 'SR', id },
|
||||||
|
},
|
||||||
|
() => Promise.reject(error)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Disposable.all(
|
||||||
|
extractIdsFromSimplePattern(job.remotes).map(id =>
|
||||||
|
this._getAdapter(id).catch(error => {
|
||||||
|
runTask(
|
||||||
|
{
|
||||||
|
name: 'get remote adapter',
|
||||||
|
data: { type: 'remote', id },
|
||||||
|
},
|
||||||
|
() => Promise.reject(error)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
),
|
||||||
async (srs, remoteAdapters) => {
|
async (srs, remoteAdapters) => {
|
||||||
|
// remove adapters that failed (already handled)
|
||||||
|
remoteAdapters = remoteAdapters.filter(_ => _ !== undefined)
|
||||||
|
|
||||||
|
// remove srs that failed (already handled)
|
||||||
|
srs = srs.filter(_ => _ !== undefined)
|
||||||
|
|
||||||
|
if (remoteAdapters.length === 0 && srs.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const vmIds = extractIdsFromSimplePattern(job.vms)
|
const vmIds = extractIdsFromSimplePattern(job.vms)
|
||||||
|
|
||||||
Task.info('vms', { vms: vmIds })
|
Task.info('vms', { vms: vmIds })
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
- [Editable number] When you are trying to edit a number and it's failing, display an error (PR [#5634](https://github.com/vatesfr/xen-orchestra/pull/5634))
|
- [Editable number] When you are trying to edit a number and it's failing, display an error (PR [#5634](https://github.com/vatesfr/xen-orchestra/pull/5634))
|
||||||
- [VM/Network] Fix `an error has occurred` when trying to sort the table by the network's name (PR [#5639](https://github.com/vatesfr/xen-orchestra/pull/5639))
|
- [VM/Network] Fix `an error has occurred` when trying to sort the table by the network's name (PR [#5639](https://github.com/vatesfr/xen-orchestra/pull/5639))
|
||||||
- [Backup] Try harder to avoid orphan VDI snapshots, especially with iSCSI SRs [#4926](https://github.com/vatesfr/xen-orchestra/issues/4926)
|
- [Backup] Try harder to avoid orphan VDI snapshots, especially with iSCSI SRs [#4926](https://github.com/vatesfr/xen-orchestra/issues/4926)
|
||||||
|
- [Backup] Disabled or unavailable remotes and SRs don't prevent job from running [#5353](https://github.com/vatesfr/xen-orchestra/issues/5353) (PR [#5651](https://github.com/vatesfr/xen-orchestra/pull/5651))
|
||||||
|
|
||||||
### Packages to release
|
### Packages to release
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user