rosa-build/config/puma/production.rb

28 lines
815 B
Ruby
Raw Normal View History

2013-11-27 18:20:05 +00:00
# -*- encoding : utf-8 -*-
base_path = "/srv/rosa_build"
2013-11-27 19:20:41 +00:00
pidfile File.join(base_path, 'shared', 'pids', 'unicorn.pid')
state_path File.join(base_path, 'shared', 'pids', 'puma.state')
bind 'unix:///tmp/rosa_build_unicorn.sock'
2013-11-27 18:20:05 +00:00
environment ENV['RAILS_ENV'] || 'production'
2013-12-03 11:09:03 +00:00
threads *(ENV['PUMA_THREADS'] || '1,4').split(',')
workers ENV['PUMA_WORKERS'] || 8
2013-11-27 18:20:05 +00:00
2013-11-27 19:18:01 +00:00
2013-11-27 18:20:05 +00:00
preload_app!
on_worker_boot do
if defined?(ActiveRecord::Base)
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
ActiveRecord::Base.establish_connection
end
# QC::Conn.connect
Rails.logger.info('Connected to PG')
end
# Redis.connect!
# Rails.logger.info('Connected to Redis')
2013-11-27 19:18:01 +00:00
end
activate_control_app 'unix:///tmp/rosa_build_pumactl.sock'