Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated DB_POOL variable

  • Loading branch information...
commit ec40018d9b4908cb0f8b784afabc5661f12f2994 1 parent f662332
@avokhmin avokhmin authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 config/puma/production.rb
View
11 config/puma/production.rb
@@ -14,7 +14,14 @@
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 @@
# 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'
Please sign in to comment.
Something went wrong with that request. Please try again.