mirror of
https://github.com/discourse/discourse.git
synced 2025-08-20 18:52:44 +08:00
FIX: Reopen sidekiq log files after rotation (#9429)
Unicorn uses the USR1 to indicate that log files should be reopened. This commit implements the same functionality for our forked sidekiq workers: - USR1 is intercepted in the unicorn master, and re-issued to all child processes - USR1 is trapped in the sidekiq processes, and `Unicorn::Util.reopen_logs` is used to re-open log files
This commit is contained in:
parent
5e24436454
commit
ed6b3b82bd
3 changed files with 25 additions and 0 deletions
|
@ -37,6 +37,13 @@ class Demon::Base
|
|||
end
|
||||
end
|
||||
|
||||
def self.kill(signal)
|
||||
return unless @demons
|
||||
@demons.values.each do |demon|
|
||||
demon.kill(signal)
|
||||
end
|
||||
end
|
||||
|
||||
attr_reader :pid, :parent_pid, :started, :index
|
||||
attr_accessor :stop_timeout
|
||||
|
||||
|
@ -63,6 +70,10 @@ class Demon::Base
|
|||
end
|
||||
end
|
||||
|
||||
def kill(signal)
|
||||
Process.kill(signal, @pid)
|
||||
end
|
||||
|
||||
def stop_signal
|
||||
"HUP"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue