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 retry_all, fixes #1851

This commit is contained in:
Mike Perham 2014-07-19 14:16:55 -07:00
parent 797c267422
commit 25b0181401

View file

@ -338,12 +338,13 @@ module Sidekiq
false
end
end
message = hash[true].first
yield message
msg = hash.fetch(true, []).first
yield msg if msg
# push the rest back onto the sorted set
conn.multi do
hash[false].each do |message|
hash.fetch(false, []).each do |message|
conn.zadd(parent.name, score.to_f.to_s, message)
end
end