This repository was archived by the owner on Jun 18, 2025. It is now read-only.
This repository was archived by the owner on Jun 18, 2025. It is now read-only.
resumeOnRestart: Successful jobs never get restarted #54
Open
Description
Description
I have some concern regarding the resumeOnRestart
option.
Imagine a situation like this:
- We have a job to run every minute
- The job successfully runs at 9:00:00
nextRunAt
is set to 9:01:00lastFinishedAt
is set to 9:00:00- Now, the server crashes at 9:00:30
- The Server successfully restarts at 9:01:20
=> Server has missed the run at 9:01:00
=> I expect the job to rerun at 9:02:00
However, if my testing is right, it will never run again because of
{
lockedAt: { $exists: false },
lastFinishedAt: { $exists: false },
nextRunAt: { $lte: now, $ne: null },
},
in resume-on-restart.ts
.
The crucial part is lastFinishedAt: { $exists: false }
.
Pulse obviously "thinks": "Oh, this got successfully finished, so we do not have to do anything here".
Code example
No response
Additional context
No response