diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/database_config.rb | 10 | ||||
-rw-r--r-- | config/initializers/geo.rb | 16 |
2 files changed, 14 insertions, 12 deletions
diff --git a/config/initializers/database_config.rb b/config/initializers/database_config.rb index b5490fc4719..52897ad549d 100644 --- a/config/initializers/database_config.rb +++ b/config/initializers/database_config.rb @@ -10,6 +10,16 @@ def log_pool_size(db, previous_pool_size, current_pool_size) Gitlab::AppLogger.debug(log_message.join(' ')) end +Gitlab.ee do + # We need to initialize the Geo database before + # setting the Geo DB connection pool size. + if File.exist?(Rails.root.join('config/database_geo.yml')) + Rails.application.configure do + config.geo_database = config_for(:database_geo) + end + end +end + # When running on multi-threaded runtimes like Puma or Sidekiq, # set the number of threads per process as the minimum DB connection pool size. # This is to avoid connectivity issues as was documented here: diff --git a/config/initializers/geo.rb b/config/initializers/geo.rb index 4cc9fbf49b2..3278dc9e484 100644 --- a/config/initializers/geo.rb +++ b/config/initializers/geo.rb @@ -1,17 +1,9 @@ # frozen_string_literal: true Gitlab.ee do - if File.exist?(Rails.root.join('config/database_geo.yml')) - Rails.application.configure do - config.geo_database = config_for(:database_geo) - end - end - - begin - if Gitlab::Geo.connected? && Gitlab::Geo.primary? - Gitlab::Geo.current_node&.update_clone_url! - end - rescue => e - warn "WARNING: Unable to check/update clone_url_prefix for Geo: #{e}" + if Gitlab::Geo.connected? && Gitlab::Geo.primary? + Gitlab::Geo.current_node&.update_clone_url! end +rescue => e + warn "WARNING: Unable to check/update clone_url_prefix for Geo: #{e}" end |