Class: Gitlab::Database::TransactionTimeoutSettings
- Inherits:
-
Object
- Object
- Gitlab::Database::TransactionTimeoutSettings
- Defined in:
- lib/gitlab/database/transaction_timeout_settings.rb
Constant Summary collapse
- SETTING =
'idle_in_transaction_session_timeout'
Instance Method Summary collapse
- #disable_timeouts ⇒ Object
-
#initialize(connection) ⇒ TransactionTimeoutSettings
constructor
A new instance of TransactionTimeoutSettings.
- #restore_timeouts ⇒ Object
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_timeouts ⇒ Object
12 13 14 |
# File 'lib/gitlab/database/transaction_timeout_settings.rb', line 12 def disable_timeouts @connection.execute("SET #{SETTING} = 0") end |
#restore_timeouts ⇒ Object
16 17 18 |
# File 'lib/gitlab/database/transaction_timeout_settings.rb', line 16 def restore_timeouts @connection.execute("RESET #{SETTING}") end |