Skip to content

Commit

Permalink
ignore errors from waitpid
Browse files Browse the repository at this point in the history
upon TERM or USR1, the child's exit status will already be read in
`kill_child`, so it cannot be read again here.
  • Loading branch information
wuputah authored and hone committed Aug 1, 2012
1 parent deb0d9f commit 7935099
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/resque/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ def work(interval = 5.0, &block)
if @child = fork
srand # Reseeding
procline "Forked #{@child} at #{Time.now.to_i}"
Process.wait(@child)
begin
Process.waitpid(@child)
rescue SystemCallError
nil
end
else
unregister_signal_handlers unless @cant_fork
procline "Processing #{job.queue} since #{Time.now.to_i}"
Expand Down

0 comments on commit 7935099

Please sign in to comment.