1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Shuffle queues in place before fetching

This commit is contained in:
fatkodima 2019-09-14 00:30:54 +03:00 committed by Mike Perham
parent 1701c83788
commit 705d6ca7ea

View file

@ -28,7 +28,7 @@ module Sidekiq
@strictly_ordered_queues = !!options[:strict]
@queues = options[:queues].map { |q| "queue:#{q}" }
if @strictly_ordered_queues
@queues = @queues.uniq
@queues.uniq!
@queues << TIMEOUT
end
end
@ -47,7 +47,7 @@ module Sidekiq
if @strictly_ordered_queues
@queues
else
queues = @queues.shuffle.uniq
queues = @queues.shuffle!.uniq
queues << TIMEOUT
queues
end