fix(xo-server): avoid sequence abort on error with proxy (#10504)

This commit is contained in:
Bastien Nollet
2026-10-14 12:30:05 +02:00
committed by GitHub
parent 865b6a84c7
commit 0bb2f12b2b
2 changed files with 9 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
// FIXME so far, no acls for schedules
import { createLogger } from '@xen-orchestra/log'
import { Task } from '@xen-orchestra/mixins/Tasks.mjs'
import { noMatchingVm } from 'xo-common/api-errors.js'
const log = createLogger('xo:schedule')
export async function getAll() {
return /* await */ this.getAllSchedules()
@@ -80,15 +82,11 @@ export async function runSequence({ schedules }) {
// we can't auto resolve array parameters, we have to resolve them by hand
const schedule = await this.getSchedule(idSchedule)
const job = await this.getJob(schedule.jobId)
try {
await this.runJob(job, schedule)
Task.set('progress', Math.round(((i + 1) * 100) / nb))
} catch (error) {
// prevent skipped backups from stopping the sequence
if (!noMatchingVm.is(error)) {
throw error
}
}
// a failing job must not prevent the next jobs in the sequence from running
await this.runJob(job, schedule).catch(error =>
log.warn('job failed, continuing sequence', { error, jobId: job.id })
)
Task.set('progress', Math.round(((i + 1) * 100) / nb))
}
})
}