lib/resque/worker.rb in resque-1.25.2 vs lib/resque/worker.rb in resque-1.26.pre.0

- old
+ new

@@ -408,23 +408,14 @@ log 'Exiting...' @shutdown = true end # Kill the child and shutdown immediately. - # If not forking, abort this process. def shutdown! shutdown if term_child - if fork_per_job? - new_kill_child - else - # Raise TermException in the same process - trap('TERM') do - # ignore subsequent terms - end - raise TermException.new("SIGTERM") - end + new_kill_child else kill_child end end @@ -627,14 +618,10 @@ def idle? state == :idle end def will_fork? - !@cant_fork && !$TESTING && fork_per_job? - end - - def fork_per_job? - ENV["FORK_PER_JOB"] != 'false' + !@cant_fork && !$TESTING && (ENV["FORK_PER_JOB"] != 'false') end # Returns a symbol representing the current worker state, # which can be either :working or :idle def state