queuery_client 1.1.4 → 1.1.5
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/lib/queuery_client/client.rb +11 -6
- data/lib/queuery_client/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: 4a1006fdef0ce698e6d38c02fcbeaab4ef928a7be704395d57da8ae963b94301
|
4
|
+
data.tar.gz: 70b2fc77eeb6ed27047db209f3aa89cd4a0b5c83fb4616535134e8d14ce537f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a0338752a52c4f67f94823139bbc78b736a24c143176e5a521c832c2dcb23bda57b3c18adfa0deacc9ab5e52e3dc43728d26db3b790b6bf5dbe64c809f0f9ff
|
7
|
+
data.tar.gz: 6f8c7c248f55ba26763e7ff90d2f52c42c9d3776bf690440dd9f3aeda1b22c3f76c109fbe705ead7fc65f03c27a4e7257f0ed2b8976e2e5f27ebafc5ac09fbae
|
@@ -17,15 +17,20 @@ module QueueryClient
|
|
17
17
|
MAX_POLLING_INTERVAL = 30
|
18
18
|
|
19
19
|
def wait_for(id, query_options)
|
20
|
-
n =
|
20
|
+
n = 1
|
21
21
|
loop do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
begin
|
23
|
+
query = get_query(id, query_options)
|
24
|
+
case query.status
|
25
|
+
when 'success', 'failed'
|
26
|
+
return query
|
27
|
+
end
|
28
|
+
rescue GarageClient::GatewayTimeout
|
29
|
+
warn "#{$PROGRAM_NAME}: warning: queuery polling timeout occurred"
|
26
30
|
end
|
31
|
+
polling_interval = [3 * n, MAX_POLLING_INTERVAL].min
|
32
|
+
sleep polling_interval
|
27
33
|
n += 1
|
28
|
-
sleep [3 * n, MAX_POLLING_INTERVAL].min
|
29
34
|
end
|
30
35
|
end
|
31
36
|
|