updated DB_POOL variable

This commit is contained in:
Vokhmin Alexey V 2014-02-11 21:48:54 +04:00
parent f662332be5
commit ec40018d9b
1 changed files with 9 additions and 2 deletions

View File

@ -14,7 +14,14 @@ 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
config = Rails.application.config.database_configuration[Rails.env]
config['reaping_frequency'] = ENV['DB_REAP_FREQ'] || 10 # seconds
config['pool'] = ENV['DB_POOL'] || 21
ActiveRecord::Base.establish_connection(config)
Rails.logger.info "Connected to PG. Connection pool size #{config['pool']}, reaping frequency #{config['reaping_frequency']}"
end
# QC::Conn.connect
Rails.logger.info('Connected to PG')
@ -24,4 +31,4 @@ on_worker_boot do
# Rails.logger.info('Connected to Redis')
end
activate_control_app 'unix:///tmp/rosa_build_pumactl.sock'
activate_control_app 'unix:///tmp/rosa_build_pumactl.sock'