Skip to content

Commit

Permalink
Take the whole RQ down if the web child goes down
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Jan 23, 2015
1 parent c58d4ef commit f282ca2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion code/queuemgr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,14 @@ def run!
pid, status = Process.wait2(-1, Process::WNOHANG) rescue nil
if pid
worker = @queues.values.find { |o| o.pid == pid }
handle_worker_close(worker, status) if worker
if worker
handle_worker_close(worker, status)
elsif @web_server == pid
# TODO: Try to restart the web server? How many times?
$log.fatal("The web server has died. Terminating this RQ instance.")
@web_server = nil
shutdown!
end
end

else
Expand Down

0 comments on commit f282ca2

Please sign in to comment.