diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-19 09:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-19 09:08:57 +0300 |
commit | 6733a7a15ceefcf4802e44f96d66a9ddd7881635 (patch) | |
tree | 77aa48fd014d8cd21fa409330c3a9ac7d88b785b /config/application.rb | |
parent | 474f24bf3bb207e188f13c89c3e4c4427b968c44 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/application.rb')
-rw-r--r-- | config/application.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb index 0216c3e7b9f..aa1a0b26d60 100644 --- a/config/application.rb +++ b/config/application.rb @@ -517,6 +517,14 @@ module Gitlab end end + # We run the contents of active_record.clear_active_connections again + # because we connect to database from routes + # https://github.com/rails/rails/blob/fdf840f69a2e33d78a9d40b91d9b7fddb76711e9/activerecord/lib/active_record/railtie.rb#L308 + initializer :clear_active_connections_again, after: :set_routes_reloader_hook do + ActiveRecord::Base.clear_active_connections! + ActiveRecord::Base.flush_idle_connections! + end + # DO NOT PLACE ANY INITIALIZERS AFTER THIS. config.after_initialize do # on_master_start yields immediately in unclustered environments and runs |