diff --git a/apps/api/app/services/checkin_scheduler.ts b/apps/api/app/services/checkin_scheduler.ts index d29694f..46f9248 100644 --- a/apps/api/app/services/checkin_scheduler.ts +++ b/apps/api/app/services/checkin_scheduler.ts @@ -33,7 +33,7 @@ export async function scheduleCheckinForInvoice( .where('status', 'scheduled') const queue = getQueue(CHECKIN_QUEUE) for (const t of existing) { - await queue.remove(`checkin:${t.id}`).catch(() => {}) + await queue.remove(`checkin-${t.id}`).catch(() => {}) t.useTransaction(trx ?? (null as never)) t.status = 'expired' await t.save() @@ -65,7 +65,7 @@ export async function scheduleCheckinForInvoice( { taskId: task.id, plain }, { delay, - jobId: `checkin:${task.id}`, + jobId: `checkin-${task.id}`, attempts: 3, backoff: { type: 'exponential', delay: 30_000 }, } @@ -88,7 +88,7 @@ export async function cancelCheckinForInvoice( const queue = getQueue(CHECKIN_QUEUE) for (const t of tasks) { - await queue.remove(`checkin:${t.id}`).catch(() => {}) + await queue.remove(`checkin-${t.id}`).catch(() => {}) t.useTransaction(trx ?? (null as never)) t.status = 'expired' await t.save() diff --git a/apps/api/app/services/relance_scheduler.ts b/apps/api/app/services/relance_scheduler.ts index 4579719..9b528b1 100644 --- a/apps/api/app/services/relance_scheduler.ts +++ b/apps/api/app/services/relance_scheduler.ts @@ -79,7 +79,8 @@ export async function scheduleRelancesForInvoice( { delay, // Idempotency : un seul job actif par task. - jobId: `relance:${task.id}`, + // BullMQ 5+ interdit `:` dans les custom jobIds → tiret. + jobId: `relance-${task.id}`, // Retry exponentiel — si Mailpit est down, BullMQ retry 5x avec // backoff (cf. backend.md §13.2). attempts: 5,