Jobs autoRun should have an max concurrent option #12965
Closed
matthijs166
started this conversation in
Feature Requests & Ideas
Replies: 2 comments
-
Looks like it's going to be supported with PR #12863 Exciting!! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Added in version: v3.49.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We’re using the Payload CMS Jobs system to queue tasks (e.g. AI generation). We have autoRun enabled with a 5-second interval to avoid rate-limit errors.
However, autoRun currently just triggers the next job every 5 seconds regardless of whether any jobs are still running.
Example of the problem:
We’ve worked around this by creating a separate job whose only purpose is to check the active job count before starting new jobs, but this is awkward and feels like unnecessary complexity. Also, the logging in the terminal is very verbose.
We also checked shouldAutoRun, but it only passes the payload prop, so we can’t use it to check for active jobs, or we stop all runners from processing.
This is not a one-off problem, we keep encountering this pattern in multiple Payload projects where we want:
Beta Was this translation helpful? Give feedback.
All reactions