From 293fa6cb53a2dc1b1aaced335b326b7b7e61805e Mon Sep 17 00:00:00 2001 From: David Genord II Date: Wed, 24 Sep 2014 10:42:34 -0400 Subject: [PATCH] Logging within signal handlers is weird Thanks @christophermanning --- lib/delayed/worker.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/delayed/worker.rb b/lib/delayed/worker.rb index 0fbd4adc0..fbdd92ac4 100644 --- a/lib/delayed/worker.rb +++ b/lib/delayed/worker.rb @@ -132,13 +132,13 @@ def name def start # rubocop:disable CyclomaticComplexity, PerceivedComplexity trap('TERM') do - say 'Exiting...' + Thread.new { say 'Exiting...' } stop raise SignalException, 'TERM' if self.class.raise_signal_exceptions end trap('INT') do - say 'Exiting...' + Thread.new { say 'Exiting...' } stop raise SignalException, 'INT' if self.class.raise_signal_exceptions && self.class.raise_signal_exceptions != :term end