pgtk 0.30.7 → 0.30.9
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 +32 -13
- data/lib/pgtk/retry.rb +5 -3
- data/lib/pgtk/stash.rb +4 -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: 4e73feebd4e15e2cd5ed8a862dd3f739e417cb2b24967efb084be032ceb4ea0a
|
|
4
|
+
data.tar.gz: 6e992abff2e960da1cf93b9bbac4c4f09a72482b65ce2e60e89e8597bb40bc20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9279442627e304c9489fba9ad8a2b3bef33fa4ec5602656cd2955f683087338f171593cc4d686a1b5b79d105bb4bb0000a99ea5176c0e64c61b709d97b400e64
|
|
7
|
+
data.tar.gz: f94ac7b9215ca461f2b9fc1692c2ba9ca5a1ad7ebc06363480812b01cc7b91a425d945f28f6f36ee52dd774f07ea016778469e3243afefba1c379f749f1a6645
|
data/Gemfile.lock
CHANGED
|
@@ -35,14 +35,14 @@ GEM
|
|
|
35
35
|
tago (~> 0.1)
|
|
36
36
|
ellipsized (0.3.0)
|
|
37
37
|
joined (0.4.0)
|
|
38
|
-
json (2.19.
|
|
38
|
+
json (2.19.4)
|
|
39
39
|
language_server-protocol (3.17.0.5)
|
|
40
40
|
lint_roller (1.1.0)
|
|
41
41
|
logger (1.7.0)
|
|
42
42
|
loog (0.8.0)
|
|
43
43
|
ellipsized
|
|
44
44
|
logger (~> 1.0)
|
|
45
|
-
minitest (6.0.
|
|
45
|
+
minitest (6.0.4)
|
|
46
46
|
drb (~> 2.0)
|
|
47
47
|
prism (~> 1.5)
|
|
48
48
|
minitest-mock (5.27.0)
|
|
@@ -52,22 +52,36 @@ GEM
|
|
|
52
52
|
minitest (>= 5.0, < 7)
|
|
53
53
|
ruby-progressbar
|
|
54
54
|
minitest-stub-const (0.6)
|
|
55
|
+
nokogiri (1.19.2-aarch64-linux-gnu)
|
|
56
|
+
racc (~> 1.4)
|
|
57
|
+
nokogiri (1.19.2-aarch64-linux-musl)
|
|
58
|
+
racc (~> 1.4)
|
|
59
|
+
nokogiri (1.19.2-arm-linux-gnu)
|
|
60
|
+
racc (~> 1.4)
|
|
61
|
+
nokogiri (1.19.2-arm-linux-musl)
|
|
62
|
+
racc (~> 1.4)
|
|
55
63
|
nokogiri (1.19.2-arm64-darwin)
|
|
56
64
|
racc (~> 1.4)
|
|
57
|
-
nokogiri (1.19.2-
|
|
65
|
+
nokogiri (1.19.2-x86_64-darwin)
|
|
58
66
|
racc (~> 1.4)
|
|
59
67
|
nokogiri (1.19.2-x86_64-linux-gnu)
|
|
60
68
|
racc (~> 1.4)
|
|
69
|
+
nokogiri (1.19.2-x86_64-linux-musl)
|
|
70
|
+
racc (~> 1.4)
|
|
61
71
|
os (1.1.4)
|
|
62
72
|
parallel (2.0.1)
|
|
63
73
|
parser (3.3.11.1)
|
|
64
74
|
ast (~> 2.4.1)
|
|
65
75
|
racc
|
|
76
|
+
pg (1.6.3)
|
|
77
|
+
pg (1.6.3-aarch64-linux)
|
|
78
|
+
pg (1.6.3-aarch64-linux-musl)
|
|
66
79
|
pg (1.6.3-arm64-darwin)
|
|
67
|
-
pg (1.6.3-
|
|
80
|
+
pg (1.6.3-x86_64-darwin)
|
|
68
81
|
pg (1.6.3-x86_64-linux)
|
|
82
|
+
pg (1.6.3-x86_64-linux-musl)
|
|
69
83
|
prism (1.9.0)
|
|
70
|
-
qbash (0.8.
|
|
84
|
+
qbash (0.8.2)
|
|
71
85
|
backtrace (> 0)
|
|
72
86
|
elapsed (> 0)
|
|
73
87
|
loog (> 0)
|
|
@@ -75,7 +89,7 @@ GEM
|
|
|
75
89
|
racc (1.8.1)
|
|
76
90
|
rack (3.2.6)
|
|
77
91
|
rainbow (3.1.1)
|
|
78
|
-
rake (13.
|
|
92
|
+
rake (13.4.2)
|
|
79
93
|
random-port (0.8.2)
|
|
80
94
|
tago (~> 0.0)
|
|
81
95
|
regexp_parser (2.12.0)
|
|
@@ -94,7 +108,7 @@ GEM
|
|
|
94
108
|
rubocop-ast (1.49.1)
|
|
95
109
|
parser (>= 3.3.7.2)
|
|
96
110
|
prism (~> 1.7)
|
|
97
|
-
rubocop-elegant (0.0.
|
|
111
|
+
rubocop-elegant (0.0.18)
|
|
98
112
|
lint_roller (~> 1.1)
|
|
99
113
|
rubocop (~> 1.75)
|
|
100
114
|
rubocop-minitest (0.39.1)
|
|
@@ -133,14 +147,19 @@ GEM
|
|
|
133
147
|
nokogiri (~> 1.10)
|
|
134
148
|
rainbow (~> 3.0)
|
|
135
149
|
slop (~> 4.4)
|
|
136
|
-
yard (0.9.
|
|
150
|
+
yard (0.9.43)
|
|
137
151
|
|
|
138
152
|
PLATFORMS
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
aarch64-linux
|
|
154
|
+
aarch64-linux-gnu
|
|
155
|
+
aarch64-linux-musl
|
|
156
|
+
arm-linux-gnu
|
|
157
|
+
arm-linux-musl
|
|
158
|
+
arm64-darwin
|
|
159
|
+
x86_64-darwin
|
|
143
160
|
x86_64-linux
|
|
161
|
+
x86_64-linux-gnu
|
|
162
|
+
x86_64-linux-musl
|
|
144
163
|
|
|
145
164
|
DEPENDENCIES
|
|
146
165
|
minitest (~> 6.0)
|
|
@@ -165,4 +184,4 @@ DEPENDENCIES
|
|
|
165
184
|
yard (~> 0.9)
|
|
166
185
|
|
|
167
186
|
BUNDLED WITH
|
|
168
|
-
2.
|
|
187
|
+
2.6.8
|
data/lib/pgtk/retry.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require_relative '../pgtk'
|
|
7
|
+
require_relative 'impatient'
|
|
7
8
|
|
|
8
9
|
# Retry is a decorator for Pool that automatically retries failed SELECT queries.
|
|
9
10
|
# It provides fault tolerance for transient database errors by retrying read-only
|
|
@@ -79,8 +80,9 @@ class Pgtk::Retry
|
|
|
79
80
|
end
|
|
80
81
|
|
|
81
82
|
# Execute a SQL query with automatic retry for SELECT queries.
|
|
82
|
-
# Also retries PG::ConnectionBad
|
|
83
|
-
#
|
|
83
|
+
# Also retries PG::ConnectionBad and Pgtk::Impatient::TooSlow errors
|
|
84
|
+
# for all query types, since they indicate the query never completed
|
|
85
|
+
# against PostgreSQL and can be safely re-issued.
|
|
84
86
|
#
|
|
85
87
|
# @param [String] sql The SQL query with params inside (possibly)
|
|
86
88
|
# @return [Array] Result rows
|
|
@@ -89,7 +91,7 @@ class Pgtk::Retry
|
|
|
89
91
|
attempt = 0
|
|
90
92
|
begin
|
|
91
93
|
@pool.exec(sql, *)
|
|
92
|
-
rescue PG::ConnectionBad => e
|
|
94
|
+
rescue PG::ConnectionBad, Pgtk::Impatient::TooSlow => e
|
|
93
95
|
attempt += 1
|
|
94
96
|
raise(e) if attempt >= @attempts
|
|
95
97
|
retry
|
data/lib/pgtk/stash.rb
CHANGED
|
@@ -338,8 +338,10 @@ class Pgtk::Stash
|
|
|
338
338
|
ret = @pool.exec(query, h[:params], h[:result])
|
|
339
339
|
@entrance.with_write_lock do
|
|
340
340
|
h = @stash[:queries][query][k]
|
|
341
|
-
h[:
|
|
342
|
-
|
|
341
|
+
if h[:stale] == mark
|
|
342
|
+
h[:ret] = ret
|
|
343
|
+
h.delete(:stale)
|
|
344
|
+
end
|
|
343
345
|
end
|
|
344
346
|
end
|
|
345
347
|
end
|
data/lib/pgtk/version.rb
CHANGED