From e0c20d16122d851d6545e947a736d41347f1d068 Mon Sep 17 00:00:00 2001 From: Jonathan Hyman Date: Fri, 10 Jan 2014 14:58:53 -0500 Subject: [PATCH] Remove async on termination of fetcher/poller, leave everything else the same. --- lib/sidekiq/launcher.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index 6ff7a087..b6e1fcae 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! - manager.async.stop(:shutdown => true, :timeout => @options[:timeout]) - fetcher.terminate if fetcher.alive? poller.terminate if poller.alive? + manager.async.stop(:shutdown => true, :timeout => @options[:timeout]) manager.wait(:shutdown) + # Requeue everything in case there was a worker who grabbed work while stopped Sidekiq::Fetcher.strategy.bulk_requeue([], @options) end