Skip to content

Commit 7935099

Browse files
wuputahhone
authored andcommitted
ignore errors from waitpid
upon TERM or USR1, the child's exit status will already be read in `kill_child`, so it cannot be read again here.
1 parent deb0d9f commit 7935099

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/resque/worker.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ def work(interval = 5.0, &block)
139139
if @child = fork
140140
srand # Reseeding
141141
procline "Forked #{@child} at #{Time.now.to_i}"
142-
Process.wait(@child)
142+
begin
143+
Process.waitpid(@child)
144+
rescue SystemCallError
145+
nil
146+
end
143147
else
144148
unregister_signal_handlers unless @cant_fork
145149
procline "Processing #{job.queue} since #{Time.now.to_i}"

0 commit comments

Comments
 (0)