debian-mirror-gitlab/lib/gitlab/database/transaction_timeout_settings.rb
2023-04-23 21:23:45 +05:30

21 lines
423 B
Ruby

# frozen_string_literal: true
module Gitlab
module Database
class TransactionTimeoutSettings
SETTING = 'idle_in_transaction_session_timeout'
def initialize(connection)
@connection = connection
end
def disable_timeouts
@connection.execute("SET #{SETTING} = 0")
end
def restore_timeouts
@connection.execute("RESET #{SETTING}")
end
end
end
end