mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Don't clear workers set until actually shutting down, #492
This commit is contained in:
parent
1ad536b090
commit
2055377187
2 changed files with 7 additions and 11 deletions
|
@ -32,9 +32,7 @@ module Sidekiq
|
|||
return if Sidekiq::Fetcher.done?
|
||||
|
||||
begin
|
||||
queue = nil
|
||||
msg = nil
|
||||
Sidekiq.redis { |conn| queue, msg = conn.blpop(*queues_cmd) }
|
||||
queue, msg = Sidekiq.redis { |conn| conn.blpop(*queues_cmd) }
|
||||
|
||||
if msg
|
||||
@mgr.async.assign(msg, queue.gsub(/.*queue:/, ''))
|
||||
|
|
|
@ -43,14 +43,6 @@ module Sidekiq
|
|||
@ready.each { |x| x.terminate if x.alive? }
|
||||
@ready.clear
|
||||
|
||||
logger.debug { "Clearing workers in redis" }
|
||||
Sidekiq.redis do |conn|
|
||||
workers = conn.smembers('workers')
|
||||
workers.each do |name|
|
||||
conn.srem('workers', name) if name =~ /:#{process_id}-/
|
||||
end
|
||||
end
|
||||
|
||||
return after(0) { signal(:shutdown) } if @busy.empty?
|
||||
logger.info { "Pausing up to #{timeout} seconds to allow workers to finish..." }
|
||||
hard_shutdown_in timeout if shutdown
|
||||
|
@ -123,6 +115,12 @@ module Sidekiq
|
|||
logger.info("Still waiting for #{@busy.size} busy workers")
|
||||
|
||||
Sidekiq.redis do |conn|
|
||||
logger.debug { "Clearing workers in redis" }
|
||||
workers = conn.smembers('workers')
|
||||
workers.each do |name|
|
||||
conn.srem('workers', name) if name =~ /:#{process_id}-/
|
||||
end
|
||||
|
||||
@busy.each do |processor|
|
||||
# processor is an actor proxy and we can't call any methods
|
||||
# that would go to the actor (since it's busy). Instead
|
||||
|
|
Loading…
Add table
Reference in a new issue