Module: Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin

Extended by:
ActiveSupport::Concern
Defined in:
lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin.rb

Instance Method Summary collapse

Instance Method Details

#force_disconnect_if_old!Object


13
14
15
16
17
18
# File 'lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin.rb', line 13

def force_disconnect_if_old!
  if force_disconnect_timer.expired?
    disconnect!
    reset_force_disconnect_timer!
  end
end

#force_disconnect_timerObject


24
25
26
# File 'lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin.rb', line 24

def force_disconnect_timer
  @force_disconnect_timer ||= ConnectionTimer.starting_now
end

#reset_force_disconnect_timer!Object


20
21
22
# File 'lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin.rb', line 20

def reset_force_disconnect_timer!
  force_disconnect_timer.reset!
end