mirror of
https://github.com/discourse/discourse.git
synced 2025-08-20 18:52:44 +08:00
FEATURE: unicorn sidekiq will restart sidekiq on complete failure.
(checks every 30 minutes for complete failure)
This commit is contained in:
parent
4aaedb82d0
commit
7c57d74e85
4 changed files with 55 additions and 0 deletions
|
@ -17,6 +17,14 @@ class Demon::Base
|
|||
end
|
||||
end
|
||||
|
||||
def self.restart
|
||||
return unless @demons
|
||||
@demons.values.each do |demon|
|
||||
demon.stop
|
||||
demon.start
|
||||
end
|
||||
end
|
||||
|
||||
def self.ensure_running
|
||||
@demons.values.each do |demon|
|
||||
demon.ensure_running
|
||||
|
@ -39,6 +47,7 @@ class Demon::Base
|
|||
if @pid
|
||||
Process.kill("HUP",@pid)
|
||||
@pid = nil
|
||||
@started = false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue