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