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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/pgtk/impatient.rb +8 -2
- data/lib/pgtk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a15b5d36eab5407bca78c591056966cee9b90167e5bfa0cc98fa36984801622a
|
|
4
|
+
data.tar.gz: bd201e64d30a88836337d86b4b3d202b708109de1676ce5d83593df8f4e4ace4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
111
|
+
rubocop-elegant (0.0.20)
|
|
112
112
|
lint_roller (~> 1.1)
|
|
113
113
|
rubocop (~> 1.75)
|
|
114
114
|
rubocop-minitest (0.39.1)
|
data/lib/pgtk/impatient.rb
CHANGED
|
@@ -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
|
-
|
|
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