mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Pipeline leads to expiry race condition, fixes #2982
This commit is contained in:
parent
77b05da266
commit
19581c4b57
1 changed files with 2 additions and 2 deletions
|
@ -80,7 +80,7 @@ module Sidekiq
|
|||
workers_key = "#{key}:workers".freeze
|
||||
nowdate = Time.now.utc.strftime("%Y-%m-%d".freeze)
|
||||
Sidekiq.redis do |conn|
|
||||
conn.pipelined do
|
||||
conn.multi do
|
||||
conn.incrby("stat:processed".freeze, procd)
|
||||
conn.incrby("stat:processed:#{nowdate}", procd)
|
||||
conn.incrby("stat:failed".freeze, fails)
|
||||
|
@ -95,7 +95,7 @@ module Sidekiq
|
|||
fails = procd = 0
|
||||
|
||||
_, _, _, msg = Sidekiq.redis do |conn|
|
||||
conn.pipelined do
|
||||
conn.multi do
|
||||
conn.sadd('processes', key)
|
||||
conn.hmset(key, 'info', json, 'busy', Processor::WORKER_STATE.size, 'beat', Time.now.to_f, 'quiet', @done)
|
||||
conn.expire(key, 60)
|
||||
|
|
Loading…
Reference in a new issue