debian-mirror-gitlab/lib/gitlab/database/transaction_timeout_settings.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
423 B
Ruby
Raw Normal View History

2023-04-23 21:23:45 +05:30
# 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