1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Terminate the poller and the fetcher synchronously.

This commit is contained in:
Jonathan Hyman 2014-01-10 11:56:20 -05:00
parent 6cd4e6a96e
commit 8d1eb10f28

View file

@ -43,12 +43,12 @@ module Sidekiq
watchdog('Launcher#stop') do
@done = true
Sidekiq::Fetcher.done!
fetcher.async.terminate if fetcher.alive?
poller.async.terminate if poller.alive?
manager.async.stop(:shutdown => true, :timeout => @options[:timeout])
manager.wait(:shutdown)
fetcher.terminate if fetcher.alive?
poller.terminate if poller.alive?
manager.wait(:shutdown)
# Requeue everything in case there was a worker who grabbed work while stopped
Sidekiq::Fetcher.strategy.bulk_requeue([], @options)
end