-
Notifications
You must be signed in to change notification settings - Fork 94
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
[Feature Request] Job throttling #672
Comments
It looks like unique jobs go in the direction of what you want and I'm looking for something similar: A way to ensure a job doing an expensive operation can't have multiple concurrently running instances, so it doesn't put too much load on another system. UniqueOpts with
So I'm thinking maybe I shouldn't use this approach. Is there a better one? |
I’m looking for a good solution to this as well. Ideally, I’d like a ByState: [Pending] mechanism that lets me insert a unique job only if another job is not in the “pending” state. If a job is already “running,” then I’d want to add a new job, because the running one may be working off stale data. For me, it’s less about strictly enforcing one-at-a-time processing and more about avoiding unnecessary contention and duplicates. In my case, various API calls update data, and I need to recalculate schedules once those updates are committed. Right now, I can just insert a job for every change, but that risks flooding the queue if a lot of updates come in at once. Ideally, I want only one pending job at a time—until that job actually starts running, at which point a new job should be scheduled if more updates arrive. |
This might already be possible, but I haven't been able to figure it out after reading the docs. If I only want a specific type of job to run 1 at a time for example, is this possible?
The text was updated successfully, but these errors were encountered: