-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Default concurrency key #1110
Comments
Good flag, there is not a default concurrency key assigned: good_job/lib/good_job/active_job_extensions/concurrency.rb Lines 92 to 106 in eb65463
I imagine I deferred this because I couldn't think of a good default: should it be the classname (because it's defined on a class)... but what about when it's defined in ApplicationJob. Should it include arguments? Those can be high cardinality. I think the simplest path here would be to call out in the Readme that a key must be provided. |
I agree that setting a good default is hard. Adding advice about this in the documentation would be helpful 👍 . Besides that I would still expect the following configuration to issue an error (or warning?), simply because no concurrency limits are applied: good_job_control_concurrency_with(
total_limit: 1,
) |
In #1145 the job class was made the default concurrency key, the docs at https://github.com/bensheldon/good_job?tab=readme-ov-file#concurrency-controls also have been expanded on a bit. I believe this can be closed now (I totally forgot to link to this issue in the PR 🤦) |
Awesome, thanks! |
First off, great job on creating the GoodJob gem!
I'm using the latest version of GoodJob (3.19).
I've noticed that when I use the following config for concurrency controls, no controls are applied, because the concurrency key becomes
nil
:The following will enqueue two jobs (when no workers are running in any form):
However, when I change the concurrency control config (by providing a key generator) with the following, only a single job is enqueued (as I would expect):
Am I missing something? I find this (default) behavior confusing, and would expect a default concurrency key being generated, when none is supplied. Correct me if I'm wrong, but I can't find anything about this in the docs as well.
I would expect something like this as a default (class name + serialized arguments as concurrency key):
Thanks!
The text was updated successfully, but these errors were encountered: