File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed
Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3- ## [ Unreleased ]
3+ ## v1.1.0
44
55- Add support for transaction ` :mode ` , useful in cases where a PgBouncer is in
66 sitting front of Postgres and in transaction mode. In this case, the default
Original file line number Diff line number Diff line change @@ -38,6 +38,17 @@ Or install it yourself as:
3838$ gem install statement_timeout
3939```
4040
41+ ## Configuration
42+
43+ ``` ruby
44+ StatementTimeout .configure do |config |
45+ # When using a connection pooler like PgBouncer while in transaction mode, it
46+ # is required that you change the default mode from :session to :transaction
47+ # otherwise the statement timeouts may be SET on the right connection.
48+ config.default_mode = :transaction
49+ end
50+ ```
51+
4152## Usage
4253
4354``` ruby
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ def local_statement_timeout=(timeout)
2424 module PostgreSQLAdapterExtension
2525 def supports_statement_timeout? = true
2626 def statement_timeout = @statement_timeout ||= query_value ( "SHOW statement_timeout" )
27+
2728 def statement_timeout = ( timeout )
2829 @statement_timeout = nil
2930
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module StatementTimeout
4- VERSION = '1.0 .0'
4+ VERSION = '1.1 .0'
55end
You can’t perform that action at this time.
0 commit comments