lib/resque/scheduler/signal_handling.rb in resque-scheduler-4.2.0 vs lib/resque/scheduler/signal_handling.rb in resque-scheduler-4.2.1
- old
+ new
@@ -11,10 +11,10 @@
# For all signals, set the shutdown flag and wait for current
# poll/enqueing to finish (should be almost instant). In the
# case of sleeping, exit immediately.
def register_signal_handlers
- %w(INT TERM USR1 USR2 QUIT).each do |sig|
+ (Signal.list.keys & %w(INT TERM USR1 USR2 QUIT)).each do |sig|
trap(sig) do
signal_queue << sig
# break sleep in the primary scheduler thread, alowing
# the signal queue to get processed as soon as possible.
@th.wakeup if @th && @th.alive?