lib/sidekiq/throttled/basic_fetch.rb in sidekiq-throttled-0.1.0 vs lib/sidekiq/throttled/basic_fetch.rb in sidekiq-throttled-0.2.0

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true # stdlib require "thread" # 3rd party require "celluloid" @@ -37,14 +38,14 @@ private # Tries to pop pair of `queue` and job `message` out of sidekiq queue. # @return [Array<String, String>, nil] def brpop - if @strictly_ordered_queues - queues = @unique_queues.dup - else - queues = @queues.shuffle.uniq - end + queues = if @strictly_ordered_queues + @unique_queues.dup + else + @queues.shuffle.uniq + end @mutex.synchronize do next if @suspended.empty? queues -= @suspended @suspended.clear