lib/resque/worker.rb in resque-1.2.1 vs lib/resque/worker.rb in resque-1.2.3
- old
+ new
@@ -112,10 +112,11 @@
if job = reserve
log "got: #{job.inspect}"
if @child = fork
+ rand # Reseeding
procline = "resque: Forked #{@child} at #{Time.now.to_i}"
$0 = procline
log! procline
Process.wait
else
@@ -243,10 +244,10 @@
# Kills the forked child immediately, without remorse. The job it
# is processing will not be completed.
def kill_child
if @child
log! "Killing child at #{@child}"
- if system("ps -ho pid,state -p #{@child}")
+ if system("ps -o pid,state -p #{@child}")
Process.kill("KILL", @child) rescue nil
else
log! "Child #{@child} not found, restarting."
shutdown
end