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

Fix race condition in Sidekiq API (#3453)

Fixes #3452.
This commit is contained in:
Jacob Evelyn 2017-05-02 13:08:26 -04:00 committed by Mike Perham
parent 3c09d3e910
commit 3d4a819390

View file

@ -725,6 +725,11 @@ module Sidekiq
end
result.each do |info, busy, at_s, quiet|
# If a process is stopped between when we query Redis for `procs` and
# when we query for `result`, we will have an item in `result` that is
# composed of `nil` values.
next if info.nil?
hash = Sidekiq.load_json(info)
yield Process.new(hash.merge('busy' => busy.to_i, 'beat' => at_s.to_f, 'quiet' => quiet))
end