Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(queue): treat the implicit single attempt as exhausted

Calvin2f2db8a8c34e
diff --git a/backend/src/queue/queue-service.ts b/backend/src/queue/queue-service.ts
index 7fcd87e9d3..e5122f7d3e 100644
--- a/backend/src/queue/queue-service.ts
+++ b/backend/src/queue/queue-service.ts
@@ -871,7 +871,7 @@ export const queueServiceFactory = (redisCfg: TRedisConfigKeys): TQueueServiceFa
}
const errorType = classifyError(err);
- const attemptsExhausted = !!(job?.opts.attempts && job.attemptsMade && job.attemptsMade >= job.opts.attempts);
+ const attemptsExhausted = !!job && job.attemptsMade >= (job.opts.attempts || 1);
queueJobFailureCounter.add(1, {
...baseAttrs,
"error.type": errorType,