-
-
Notifications
You must be signed in to change notification settings - Fork 280
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 dynamic adding queues #322
Conversation
49f5175
to
f90521c
Compare
lib/shoryuken/environment_loader.rb
Outdated
@@ -99,7 +99,7 @@ def prefix_active_job_queue_names | |||
end | |||
|
|||
def parse_queue(queue, weight = nil) | |||
[weight.to_i, 1].max.times { Shoryuken.queues << queue } | |||
Shoryuken.add_queue(queue, [weight.to_i, 1]) |
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.
You have not take the max of [weight.to_i, 1]
but is it OK?
I think that add_queue
takes weight
which is defined numeric.
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.
@h3poteto nice! thanks for reviewing it. I meant [weight.to_i, 1].max
.
This code needs a test rspec
. Not sure how tests are passing, even the integration one.
lib/shoryuken/environment_loader.rb
Outdated
@@ -99,7 +99,7 @@ def prefix_active_job_queue_names | |||
end | |||
|
|||
def parse_queue(queue, weight = nil) | |||
Shoryuken.add_queue(queue, [weight.to_i, 1]) | |||
Shoryuken.add_queue(queue, [weight.to_i, 1].max) |
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.
Fix #282