pgtk 0.31.0 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bce43b422e6baef8427e57d0635f613f2af93eea4a2f783b2fa62c85520b565
4
- data.tar.gz: ea73771e5ea9c4f17919d257316d548280cf623e77f50266f6283e8f0ed71d8b
3
+ metadata.gz: a15b5d36eab5407bca78c591056966cee9b90167e5bfa0cc98fa36984801622a
4
+ data.tar.gz: bd201e64d30a88836337d86b4b3d202b708109de1676ce5d83593df8f4e4ace4
5
5
  SHA512:
6
- metadata.gz: 908b1a4e77e794a5d91aae82169969bac770d3638771356f65b7f5ac7b2b490b14a99f5cc7caba4e63e99e09678d423f51944faf52f6c368040a6f4d55eb9b78
7
- data.tar.gz: 5a15b9c10cb8f238b00888d761436633d8381e7b52c731af3c8fa67c5c4c48cd27274dc3975d9b3eaf612f189ffa871c026eca758991924b4d0aa3b3a4b9099a
6
+ metadata.gz: 8b58b179b7c85ff2183d7c909da288f9a4be5c67bbe8040350c8706098bac8ccbfe05010d638f28db67cf70b1434744abc6667008f1fcc32bdc6aaa3a4cb1fd8
7
+ data.tar.gz: 0da90a8d6b61c07125bab269833149217f625caadbfbb8e12363ac84f84efa36e321fb6ec18f5b12c0b1bb9dfdab42ad74086cb6300b9fb0b122e2a52e9384cf
data/Gemfile.lock CHANGED
@@ -42,7 +42,7 @@ GEM
42
42
  loog (0.8.0)
43
43
  ellipsized
44
44
  logger (~> 1.0)
45
- minitest (6.0.4)
45
+ minitest (6.0.5)
46
46
  drb (~> 2.0)
47
47
  prism (~> 1.5)
48
48
  minitest-mock (5.27.0)
@@ -108,7 +108,7 @@ GEM
108
108
  rubocop-ast (1.49.1)
109
109
  parser (>= 3.3.7.2)
110
110
  prism (~> 1.7)
111
- rubocop-elegant (0.0.18)
111
+ rubocop-elegant (0.0.20)
112
112
  lint_roller (~> 1.1)
113
113
  rubocop (~> 1.75)
114
114
  rubocop-minitest (0.39.1)
@@ -119,13 +119,19 @@ class Pgtk::Impatient
119
119
  end
120
120
  end
121
121
 
122
- # Run a transaction with a timeout for each query.
122
+ # Run a transaction with a timeout for each query and for idle time inside
123
+ # the transaction. If the transaction stays in the +INTRANS+ state (idle
124
+ # inside transaction) for longer than the configured timeout, PostgreSQL
125
+ # terminates the session, which frees locks and releases the connection
126
+ # slot back to the pool.
123
127
  #
124
128
  # @yield [Pgtk::Impatient] Yields an impatient transaction
125
129
  # @return [Object] Result of the block
126
130
  def transaction
127
131
  @pool.transaction do |t|
128
- t.exec("SET LOCAL statement_timeout = #{Integer((@timeout * 1000).to_s, 10)}")
132
+ ms = Integer((@timeout * 1000).to_s, 10)
133
+ t.exec("SET LOCAL statement_timeout = #{ms}")
134
+ t.exec("SET LOCAL idle_in_transaction_session_timeout = #{ms}")
129
135
  yield(Pgtk::Impatient.new(t, @timeout))
130
136
  end
131
137
  end
data/lib/pgtk/version.rb CHANGED
@@ -10,5 +10,5 @@ require_relative '../pgtk'
10
10
  # Copyright:: Copyright (c) 2019-2026 Yegor Bugayenko
11
11
  # License:: MIT
12
12
  module Pgtk
13
- VERSION = '0.31.0' unless defined?(VERSION)
13
+ VERSION = '0.31.1' unless defined?(VERSION)
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgtk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.31.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko