OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/config/initializers/database_pool_size.rb

9 lines
510 B

config = Rails.env.production? && Rails.application.config.database_configuration[Rails.env]
pool_size = config && [OpenProject::Configuration.web_max_threads + 1, config['pool'].to_i].max
# make sure we have enough connections in the pool for each thread and then some
if pool_size && pool_size > ActiveRecord::Base.connection_pool.size
Rails.logger.debug { "Increasing database pool size to #{pool_size} to match max threads" }
ActiveRecord::Base.establish_connection config.merge(pool: pool_size)
end