1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Reopen log file after receiving USR2 signal

This commit is contained in:
Thorsten Ball 2012-12-11 16:04:07 +01:00
parent d2c2da6be9
commit 8b2ff6c951

View file

@ -15,6 +15,11 @@ trap 'USR1' do
mgr.async.stop if mgr
end
trap 'USR2' do
Sidekiq.logger.info "Received USR2, reopening log file"
Sidekiq.logger = Sidekiq::Logging.new_file_logger(Sidekiq.options[:logfile])
end
trap 'TTIN' do
Thread.list.each do |thread|
Sidekiq.logger.info "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"