-
Notifications
You must be signed in to change notification settings - Fork 369
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
Make sidekiq queue configurable #438
Conversation
This allows users to configure wich sidekiq queue to use, so that the default job/strategy can be used with existing setups.
Hey, can you add a couple of specs here please? |
@pyromaniac I must obviously fix the existing tests. |
Hm, why can't we simply do it like this? #437 |
and properly scope the Sidekiq namespace
I mean, why can't you do like |
In that case I'd have to make sure that the option-setting code is run after after any initializer that sets the queue, and the queue cannot be modified at runtime. With my version, it just fetches the queue name at the time when it enqueues the job. |
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.
This is awesome. Let's merge it then. I would ask you to do the same for all of the strategies, but it would be too shameless, right? :) Can you fix one small issue please only?
private | ||
|
||
def sidekiq_queue | ||
Chewy.settings.fetch(:sidekiq, {})[:queue] || 'chewy' |
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.
Let's maybe Chewy.settings return some default value?
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.
Ummm... I'm not sure how to do that. Chewy.settings is a simple hash, and it can (and is, in the tests) be directly assigned to.
So while I can put a default somewhere in the Config class, I cannot make sure that the value does always exist. So we'd still need the fallback in this place...
Also, maybe a couple of specs would be perfect here |
...that should probably not go upstream... This reverts commit cce4f3b.
@pyromaniac I added a little test piece, it'd be great if this could be merged. I'm not sure what you meant by "the same for all other strategies - the sidekiq queue setting obviously only makes sense for sidekiq. Or did you meant "make all other strategies configurable"? -> I have no idea what configuration the other strategies would need... |
@pyromaniac do you have any idea why the build fails? It doesn't seem related to my change... |
I meant "make all other strategies configurable", but don't worry, agree with you. As for CI -
It is really strange, can you rebase on master? If will not help - just remove |
Got it now. Lock the elasticsearch-transport on earlier version, the latest one is broken somehow |
@pyromaniac - do I need to do anything, or will you take care of it? |
Fix specs please by locking es gem version and I'll merge it. |
Try to merge this and take a look on the result :) |
Thanks for the PR, seems like after master fixes it was merged without causing any troubles. |
This allows users to configure wich sidekiq queue to use,
so that the default job/strategy can be used with existing
setups.