Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResumeOnRestart reprocess already recurrent jobs #55

Open
jaeecheveste opened this issue Sep 11, 2024 · 1 comment
Open

ResumeOnRestart reprocess already recurrent jobs #55

jaeecheveste opened this issue Sep 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jaeecheveste
Copy link

Description

This query updates wrongly already processed jobs:
this._collection
.updateMany(
{
$or: [
{
lockedAt: { $exists: true },
nextRunAt: { $ne: null },
$or: [{ $expr: { $eq: ['$runCount', '$finishedCount'] } }, { lastFinishedAt: { $exists: false } }],
},
{
lockedAt: { $exists: false },
lastFinishedAt: { $exists: false },
nextRunAt: { $lte: now, $ne: null },
},
],
},
{
$unset: { lockedAt: undefined, lastModifiedBy: undefined, lastRunAt: undefined },
$set: { nextRunAt: now },
}
)

I have successfull recurrent jobs where runCount matches finishedCount. resumeOnRestart changes me nextRunAt and ALL executed job are executed again.
$or: [{ $expr: { $eq: ['$runCount', '$finishedCount'] } }, { lastFinishedAt: { $exists: false } }],

Code example

No response

Additional context

No response

@jaeecheveste jaeecheveste added the bug Something isn't working label Sep 11, 2024
@jaeecheveste jaeecheveste changed the title ResumeOnRestart reprocess recurrent jobs ResumeOnRestart reprocess already recurrent jobs Sep 11, 2024
@jaeecheveste
Copy link
Author

I think runCount should be non equal to finishedCount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants