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

Allow using queue prefix with a default queue name #34376

Merged
merged 1 commit into from Nov 23, 2018

Conversation

composerinteralia
Copy link
Member

@composerinteralia composerinteralia commented Nov 4, 2018

Fixes #34366

Currently setting queue_name_prefix will not combine a prefix with the
default_queue_name; it will only affect queue names set with queue_as.
With this PR the prefix will affect the default_queue_name as well.

Closes #19831

Currently setting default_queue_name doesn't actually affect the
queue_name default (although default_queue_name does get used if you
pass a falsey part_name to queue_as). This PR would get
default_queue_name working as expected as well.

Because the queue_name default is now a lambda wrapping the
default_queue_name, rather than the default_queue_name itself, I had to
update one test to use the instance method #queue_name (which
instance_execs the value) instead of the class method. I think this
change is OK, since only the instance method is documented.

There was a question about whether we want a default_queue_name
configuration. If we want to get rid of it, I would also be happy to
open a PR for that instead. It has been around for a while now, but it
also hasn't really worked for a while now.

r? @matthewd
since you had an opinion about this before

Fixes rails#34366

Currently setting queue_name_prefix will not combine a prefix with the
default_queue_name; it will only affect queue names set with `queue_as`.
With this PR the prefix will affect the default_queue_name as well.

Closes rails#19831

Currently setting default_queue_name doesn't actually affect the
queue_name default (although default_queue_name does get used if you
pass a falsey `part_name` to `queue_as`). This PR would get
default_queue_name working as expected as well.

Because the queue_name default is now a lambda wrapping the
default_queue_name, rather than the default_queue_name itself, I had to
update one test to use the instance method `#queue_name` (which
`instance_exec`s the value) instead of the class method. I think this
change is OK, since only the instance method is documented.

There was a question about whether we want a `default_queue_name`
configuration. If we want to get rid of it, I would also be happy to
open a PR for that instead. It has been around for a while now, but it
also hasn't really worked for a while now.

r? @matthewd
since you had an opinion about this before
Copy link
Member

@Edouard-chin Edouard-chin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveJob queue_name_prefix not applied when using default queue name
4 participants