vidpush/config/unicorn.rb

22 lines
585 B
Ruby
Raw Normal View History

2014-04-29 18:08:19 +00:00
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
2014-04-07 18:41:34 +00:00
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
2014-04-29 18:08:19 +00:00
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
2014-04-07 18:41:34 +00:00
end
after_fork do |server, worker|
Signal.trap 'TERM' do
2014-04-29 18:08:19 +00:00
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
2014-04-07 18:41:34 +00:00
end
2014-04-29 18:08:19 +00:00
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end