Class: Gitlab::Database::TransactionTimeoutSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/database/transaction_timeout_settings.rb

Constant Summary collapse

SETTING =
'idle_in_transaction_session_timeout'

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ TransactionTimeoutSettings

Returns a new instance of TransactionTimeoutSettings.



8
9
10
# File 'lib/gitlab/database/transaction_timeout_settings.rb', line 8

def initialize(connection)
  @connection = connection
end

Instance Method Details

#disable_timeoutsObject



12
13
14
# File 'lib/gitlab/database/transaction_timeout_settings.rb', line 12

def disable_timeouts
  @connection.execute("SET #{SETTING} = 0")
end

#restore_timeoutsObject



16
17
18
# File 'lib/gitlab/database/transaction_timeout_settings.rb', line 16

def restore_timeouts
  @connection.execute("RESET #{SETTING}")
end