diff options
Diffstat (limited to 'config/initializers/active_record_force_reconnects.rb')
-rw-r--r-- | config/initializers/active_record_force_reconnects.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/active_record_force_reconnects.rb b/config/initializers/active_record_force_reconnects.rb new file mode 100644 index 00000000000..73dfaf5e121 --- /dev/null +++ b/config/initializers/active_record_force_reconnects.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +Gitlab::Database::ConnectionTimer.configure do |config| + config.interval = Rails.application.config_for(:database)[:force_reconnect_interval] +end + +ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin) |