diff options
Diffstat (limited to 'lib/gitlab/database.rb')
-rw-r--r-- | lib/gitlab/database.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index 82ec740ade1..a614e68703c 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -204,15 +204,16 @@ module Gitlab # pool_size - The size of the DB pool. # host - An optional host name to use instead of the default one. def self.create_connection_pool(pool_size, host = nil, port = nil) - # See activerecord-4.2.7.1/lib/active_record/connection_adapters/connection_specification.rb env = Rails.env - original_config = ActiveRecord::Base.configurations + original_config = ActiveRecord::Base.configurations.to_h env_config = original_config[env].merge('pool' => pool_size) env_config['host'] = host if host env_config['port'] = port if port - config = original_config.merge(env => env_config) + config = ActiveRecord::DatabaseConfigurations.new( + original_config.merge(env => env_config) + ) spec = ActiveRecord:: |