-
-
Notifications
You must be signed in to change notification settings - Fork 18
fix: correct state transition requirements #151
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
Conversation
|
Changed to master and ran |
|
there is at least 1 testing failing because of your change:
the initial job state is |
|
|
||
| shouldRun(job: JobData): boolean { | ||
| return ["waiting", "running"].includes(job.state); | ||
| return ["claimed", "running"].includes(job.state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep waiting, running and claimed.
we should be able to programmatically snooze a waiting job.
We're expecting the outcome of the snooze to be "waiting" here which is what snooze does, so this shouldn't error? But I'll also include the original waiting, even though it's a no-op. |
|
Sorry, linked the wrong code. When creating the job using the builder the default and initial state of the job is waiting, this is the right code: https://github.com/sidequestjs/sidequest/blob/master/packages/engine/src/job/job-builder.ts#L233 Sharing more about the feature, let's say a job was scheduled, and for some reason you have to postpone it's execution. Then a snooze call should do the trick, so basically we should be able to move a job from |
## [1.13.2](v1.13.1...v1.13.2) (2026-01-02) ### Bug Fixes * allowing snooze claimed jobs ([#151](#151)) ([c3c2fe9](c3c2fe9))
|
🎉 This PR is included in version 1.13.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Checklist for Pull Requests
yarn test:allandyarn test:integration)Summary of Changes
#150
Updated the SnoozeTransition transition to correctly transition jobs which are claimed but are not executable because of queue restrictions, back to waiting to retry execution.