fix for unicorn usr2 signal handling
This commit is contained in:
@@ -24,18 +24,18 @@ stdout_path "/dev/null"
|
||||
# Set master PID location
|
||||
pid "#{app_path}/tmp/pids/unicorn.pid"
|
||||
|
||||
# before_fork do |server, worker|
|
||||
# ActiveRecord::Base.connection.disconnect!
|
||||
before_fork do |server, worker|
|
||||
ActiveRecord::Base.connection.disconnect!
|
||||
|
||||
# old_pid = "#{server.config[:pid]}.oldbin"
|
||||
# if File.exists?(old_pid) && server.pid != old_pid
|
||||
# begin
|
||||
# Process.kill("QUIT", File.read(old_pid).to_i)
|
||||
# rescue Errno::ENOENT, Errno::ESRCH
|
||||
# # someone else did our job for us
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
old_pid = "#{server.config[:pid]}.oldbin"
|
||||
if File.exists?(old_pid) && server.pid != old_pid
|
||||
begin
|
||||
Process.kill("QUIT", File.read(old_pid).to_i)
|
||||
rescue Errno::ENOENT, Errno::ESRCH
|
||||
# someone else did our job for us
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# after_fork do |server, worker|
|
||||
# ActiveRecord::Base.establish_connection
|
||||
|
||||
Reference in New Issue
Block a user