fix(xo-server/migrateLegacyBackupJob): dont migrate when ids contain :

This commit is contained in:
Julien Fontanet 2018-12-05 17:49:07 +01:00
parent 629931782e
commit 7089ee778a

View File

@ -146,9 +146,11 @@ export const translateLegacyJob = (
const { id } = job
let method, schedule
if (
id.includes(':') ||
job.type !== 'call' ||
(method = methods[job.method]) === undefined ||
(schedule = schedules.find(_ => _.jobId === id)) === undefined
(schedule = schedules.find(_ => _.jobId === id)) === undefined ||
schedule.id.includes(':')
) {
throw new Error(`cannot convert job ${job.id}`)
}