From 8d1eb10f284d6b132c737a3b75c231fc83bfc365 Mon Sep 17 00:00:00 2001 From: Jonathan Hyman Date: Fri, 10 Jan 2014 11:56:20 -0500 Subject: [PATCH] Terminate the poller and the fetcher synchronously. --- lib/sidekiq/launcher.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index e779f8d6..6ff7a087 100644 --- a/lib/sidekiq/launcher.rb +++ b/lib/sidekiq/launcher.rb @@ -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