From 705d6ca7ea2ce73b3244b740fc0d0f8f19db8c60 Mon Sep 17 00:00:00 2001 From: fatkodima Date: Sat, 14 Sep 2019 00:30:54 +0300 Subject: [PATCH] Shuffle queues in place before fetching --- lib/sidekiq/fetch.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sidekiq/fetch.rb b/lib/sidekiq/fetch.rb index ac5f1a83..1f90b0c2 100644 --- a/lib/sidekiq/fetch.rb +++ b/lib/sidekiq/fetch.rb @@ -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