From ada41b8d222967cec4e91c9344a258b32653207c Mon Sep 17 00:00:00 2001 From: Dan Peterson Date: Thu, 26 May 2011 09:28:26 -0300 Subject: [PATCH 1/2] Add rake the Gemfile's test group. --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index ea8944b56..9b421313b 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source :rubygems gemspec group :test do + gem "rake" gem "rack-test", "~> 0.5" gem "mocha", "~> 0.9.7" gem "leftright", :platforms => :mri_18 From f3bbf9916e515a7817d6d592c4549ffde62774b2 Mon Sep 17 00:00:00 2001 From: Dan Peterson Date: Thu, 26 May 2011 09:28:56 -0300 Subject: [PATCH 2/2] Change worker exit to use `exit` instead of `exit!`. `exit!` causes any `at_exit` hooks used by performed code to be ignored. --- lib/resque/worker.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb index b5f6e6529..77aa5f545 100644 --- a/lib/resque/worker.rb +++ b/lib/resque/worker.rb @@ -128,7 +128,7 @@ def work(interval = 5.0, &block) else procline "Processing #{job.queue} since #{Time.now.to_i}" perform(job, &block) - exit! unless @cant_fork + exit unless @cant_fork end done_working @@ -302,7 +302,7 @@ def kill_child def paused? @paused end - + # Stop processing jobs after the current one has completed (if we're # currently running one). def pause_processing