fix(xo-server): fix running replication job (#6437)

Introduced by 2d6b827fd
This commit is contained in:
Florent BEAUCHAMP 2022-09-28 15:38:54 +02:00 committed by GitHub
parent 3d3b63a596
commit d87210e903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -23,4 +23,5 @@
<!--packages-start-->
- xo-server patch
<!--packages-end-->

View File

@ -229,11 +229,17 @@ export default class BackupNg {
}
}),
])
if (Object.keys(remotes).length === 0) {
// Fails the job if all remotes are disabled
//
// TODO: integrate each failure in its own tasks and still proceed
// with other tasks like rolling snapshot and replication.
if (remoteIds.length > 0 && Object.keys(remotes).length === 0) {
const error = new Error(`couldn't instantiate any remote`)
error.errors = remoteErrors
throw error
}
// update remotes list with only the enabled remotes
job.remotes = {
id: {