mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Simplify BasicFetch#queues_cmd
And improve weight honoring.
This commit is contained in:
parent
5804ad67d3
commit
8783c4ac1d
1 changed files with 1 additions and 3 deletions
|
@ -93,9 +93,7 @@ module Sidekiq
|
|||
# recreate the queue command each time we invoke Redis#blpop
|
||||
# to honor weights and avoid queue starvation.
|
||||
def queues_cmd
|
||||
return @unique_queues.dup << Sidekiq::Fetcher::TIMEOUT if @strictly_ordered_queues
|
||||
queues = @queues.sample(@unique_queues.size).uniq
|
||||
queues.concat(@unique_queues - queues)
|
||||
queues = @strictly_ordered_queues ? @unique_queues.dup : @queues.shuffle.uniq
|
||||
queues << Sidekiq::Fetcher::TIMEOUT
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue