File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ def work(interval = 5.0, &block)
141141 procline "Forked #{ @child } at #{ Time . now . to_i } "
142142 Process . wait ( @child )
143143 else
144+ unregister_signal_handlers unless @cant_fork
144145 procline "Processing #{ job . queue } since #{ Time . now . to_i } "
145146 redis . client . reconnect # Don't share connection with parent
146147 perform ( job , &block )
@@ -283,6 +284,18 @@ def register_signal_handlers
283284 log! "Registered signals"
284285 end
285286
287+ def unregister_signal_handlers
288+ trap ( 'TERM' , 'DEFAULT' )
289+ trap ( 'INT' , 'DEFAULT' )
290+
291+ begin
292+ trap ( 'QUIT' , 'DEFAULT' )
293+ trap ( 'USR1' , 'DEFAULT' )
294+ trap ( 'USR2' , 'DEFAULT' )
295+ rescue ArgumentError
296+ end
297+ end
298+
286299 # Schedule this worker for shutdown. Will finish processing the
287300 # current job.
288301 def shutdown
You can’t perform that action at this time.
0 commit comments