Skip to content

Commit aa5323b

Browse files
committed
fix: check if lockedAt has been resetted in the meantime
1 parent 8e3b827 commit aa5323b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/JobProcessor.ts

+9
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,15 @@ export class JobProcessor {
525525
return;
526526
}
527527

528+
if (!job.attrs.lockedAt) {
529+
reject(
530+
new Error(
531+
`execution of '${job.attrs.name}' canceled, no lockedAt date found. Ensure to call touch() for long running jobs to keep them alive.`
532+
)
533+
);
534+
return;
535+
}
536+
528537
resolve(checkIfJobIsStillAlive());
529538
}, Math.max(this.processEvery / 2, this.agenda.definitions[job.attrs.name].lockLifetime / 2));
530539
});

0 commit comments

Comments
 (0)