From 38123fe7aa446c67176e15c9b426a13497fc10c3 Mon Sep 17 00:00:00 2001 From: Anatoliy Kolodkin Date: Thu, 12 Jun 2025 10:42:04 -0500 Subject: [PATCH] Modifies the condition for the 'lockedAt' field to check for non-null values instead of existence. Prevents accidental resumption or resetting of jobs that are not actively locked but happen to have a lockedAt field set to null. --- src/pulse/resume-on-restart.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulse/resume-on-restart.ts b/src/pulse/resume-on-restart.ts index 8b77a3b..c5b078a 100644 --- a/src/pulse/resume-on-restart.ts +++ b/src/pulse/resume-on-restart.ts @@ -23,7 +23,7 @@ export const resumeOnRestart: ResumeOnRestartMethod = function (this: Pulse, res { $or: [ { - lockedAt: { $exists: true }, + lockedAt: { $ne: null }, nextRunAt: { $ne: null }, $or: [{ $expr: { $eq: ['$runCount', '$finishedCount'] } }, { lastFinishedAt: { $exists: false } }], },