mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
polish
This commit is contained in:
parent
62b912528e
commit
96d6c71573
2 changed files with 6 additions and 5 deletions
|
@ -64,9 +64,11 @@ module Sidekiq
|
|||
sleep
|
||||
rescue Interrupt
|
||||
logger.info 'Shutting down'
|
||||
poller.terminate
|
||||
poller.terminate if poller.alive?
|
||||
@manager.stop!(:shutdown => true, :timeout => options[:timeout])
|
||||
@manager.wait(:shutdown)
|
||||
# Explicitly exit so busy Processor threads can't block
|
||||
# process shutdown.
|
||||
exit(0)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,7 +38,6 @@ module Sidekiq
|
|||
timeout = options[:timeout]
|
||||
|
||||
@done = true
|
||||
|
||||
@fetcher.terminate if @fetcher.alive?
|
||||
|
||||
logger.info { "Shutting down #{@ready.size} quiet workers" }
|
||||
|
@ -55,7 +54,7 @@ module Sidekiq
|
|||
|
||||
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
|
||||
hard_shutdown_in timeout if shutdown
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -108,8 +107,8 @@ module Sidekiq
|
|||
private
|
||||
|
||||
def hard_shutdown_in(delay)
|
||||
watchdog("Manager#watch_for_shutdown died") do
|
||||
after(delay) do
|
||||
watchdog("Manager#watch_for_shutdown died") do
|
||||
# We've reached the timeout and we still have busy workers.
|
||||
# They must die but their messages shall live on.
|
||||
logger.info("Still waiting for #{@busy.size} busy workers")
|
||||
|
|
Loading…
Add table
Reference in a new issue