Skip to content

Commit

Permalink
handle case where all queues are paused, fixes #4825
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Feb 23, 2021
1 parent 285d654 commit ed84837
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/sidekiq/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ def initialize(options)
end

def retrieve_work
work = Sidekiq.redis { |conn| conn.brpop(*queues_cmd) }
qs = queues_cmd
# 4825 Sidekiq Pro with all queues paused will return an
# empty set of queues with a trailing TIMEOUT value.
if qs.size <= 1
sleep(2)
return nil
end

work = Sidekiq.redis { |conn| conn.brpop(*qs) }
UnitOfWork.new(*work) if work
end

Expand Down

0 comments on commit ed84837

Please sign in to comment.