asciinema.org/config/unicorn.rb

18 lines
430 B
Ruby
Raw Normal View History

2012-06-09 13:23:56 +00:00
worker_processes (ENV['UNICORN_WORKERS'] || 3).to_i
timeout 30
preload_app true
before_fork do |server, worker|
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
Rails.logger.info('Disconnected from ActiveRecord')
end
end
after_fork do |server, worker|
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
Rails.logger.info('Connected to ActiveRecord')
end
end