From fd93741c65f24330996b1d52362d3a1afe6e75e3 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Mon, 15 Apr 2013 22:37:40 -0700 Subject: [PATCH] disable prefork/postfork code --- config/unicorn.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/config/unicorn.rb b/config/unicorn.rb index ecb5357d5..b45b362ff 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -32,19 +32,19 @@ stdout_path "log/unicorn.log" # 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 -end \ No newline at end of file +# after_fork do |server, worker| +# ActiveRecord::Base.establish_connection +# end \ No newline at end of file