Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/active_record_lifecycle.rb')
-rw-r--r--config/initializers/active_record_lifecycle.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/config/initializers/active_record_lifecycle.rb b/config/initializers/active_record_lifecycle.rb
index 92cc1d81617..73df2b41a04 100644
--- a/config/initializers/active_record_lifecycle.rb
+++ b/config/initializers/active_record_lifecycle.rb
@@ -5,7 +5,9 @@
if defined?(ActiveRecord::Base) && !Gitlab::Runtime.sidekiq?
Gitlab::Cluster::LifecycleEvents.on_worker_start do
ActiveSupport.on_load(:active_record) do
- ActiveRecord::Base.establish_connection # rubocop: disable Database/EstablishConnection
+ # rubocop:disable Database/MultipleDatabases
+ ActiveRecord::Base.establish_connection # rubocop:disable Database/EstablishConnection
+ # rubocop:enable Database/MultipleDatabases
Gitlab::AppLogger.debug("ActiveRecord connection established")
end
@@ -18,8 +20,8 @@ if defined?(ActiveRecord::Base)
# the following is highly recommended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
- ActiveRecord::Base.connection.disconnect!
+ ActiveRecord::Base.clear_all_connections! # rubocop:disable Database/MultipleDatabases
- Gitlab::AppLogger.debug("ActiveRecord connection disconnected")
+ Gitlab::AppLogger.debug("ActiveRecord connections disconnected")
end
end