rosa-build/config/puma/production.rb

31 lines
958 B
Ruby
Raw Permalink Normal View History

2015-11-09 13:29:21 +00:00
base_path = "/app/rosa-build"
bind 'unix:///app/rosa-build/rosa_build.sock'
2013-11-27 18:20:05 +00:00
environment ENV['RAILS_ENV'] || 'production'
2015-02-12 23:25:11 +00:00
threads *(ENV['PUMA_THREADS'] || '16,16').split(',')
2013-12-06 08:10:08 +00:00
workers ENV['PUMA_WORKERS'] || 7
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
2014-02-11 17:48:54 +00:00
config = Rails.application.config.database_configuration[Rails.env]
2015-02-12 23:25:11 +00:00
# config['reaping_frequency'] = ENV['DB_REAP_FREQ'] || 10 # seconds
# config['pool'] = ENV['DB_POOL'] || 3
2014-02-11 17:48:54 +00:00
ActiveRecord::Base.establish_connection(config)
Rails.logger.info "Connected to PG. Connection pool size #{config['pool']}, reaping frequency #{config['reaping_frequency']}"
2013-11-27 18:20:05 +00:00
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