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:
parent
797c267422
commit
25b0181401
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue