lucid-shopify 0.53.0 → 0.54.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c386bf0d788907ef89a2afd1a63e021ee3c571f24fb7fdd23bb3131a8e321e05
4
- data.tar.gz: f3b2419bd36bde308c7eff2620fb56cc584d00d4e60cef27fe4882d2a8b8c423
3
+ metadata.gz: 4b8e5b6fbcfc27b35f4a42b7ddf072c06424d7e194407f31a4869d3876280c51
4
+ data.tar.gz: 5bf6322be4b32821508883d4ebbad90279357a8e578c1d808befdf0b1071342e
5
5
  SHA512:
6
- metadata.gz: f50495b669126839c6ab25f0e1ae6d4822689b758fd5da26f97919da3a4ee703d1cbdd7480e99465c56748d8d5a9ddc6460abe1da3baf305874cce8d61c2313d
7
- data.tar.gz: dc0c291c8008c18aab7a240fa553cafa01baaa382026148f77b9d10903d855a5d5bc2ba1d5a7b49ac985981dcc1c941d9deec4f9061aaddb7752ce14a6ba7ba9
6
+ metadata.gz: 4885a6adefc994b3d0f39159a1dc93cd76d83e88f506866f0e801aa62e9cf9e5b539e122f0595776da2464a0374393ba62e102174da6961cc11809b7d3f89920
7
+ data.tar.gz: ecd9a0251f1d4e7be6afcacaf218b621d9b111d560ed30ee9075140a3406fd4a2c0eb74edb31bfc2832cef049e13300632f01e6810892063f43b2b4edb9cad29
@@ -48,10 +48,11 @@ module Lucid
48
48
  end
49
49
 
50
50
  # @param query [String] the GraphQL query
51
+ # @param delay [Integer] delay between polling requests in seconds
51
52
  # @param http [HTTP::Client]
52
53
  #
53
54
  # @yield [Hash] each parsed line of JSONL (streamed to limit memory usage)
54
- def call(query, http: Container[:http], &block)
55
+ def call(query, delay: 1, http: Container[:http], &block)
55
56
  id = client.post_graphql(credentials, <<~QUERY)['data']['bulkOperationRunQuery']['bulkOperation']['id']
56
57
  mutation {
57
58
  bulkOperationRunQuery(
@@ -70,7 +71,7 @@ module Lucid
70
71
  }
71
72
  QUERY
72
73
 
73
- url = poll(id)
74
+ url = poll(id, delay: delay)
74
75
 
75
76
  # TODO: Verify signature?
76
77
 
@@ -93,9 +94,10 @@ module Lucid
93
94
  end
94
95
 
95
96
  # @param id [Integer] of the bulk operation
97
+ # @param delay [Integer]
96
98
  #
97
99
  # @return [String] the download URL
98
- private def poll(id)
100
+ private def poll(id, delay:)
99
101
  op = client.post_graphql(credentials, <<~QUERY)['data']['currentBulkOperation']
100
102
  {
101
103
  currentBulkOperation {
@@ -118,7 +120,9 @@ module Lucid
118
120
  when 'COMPLETED'
119
121
  op['url']
120
122
  else
121
- poll(id)
123
+ sleep(delay)
124
+
125
+ poll(id, delay: delay)
122
126
  end
123
127
  end
124
128
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lucid
4
4
  module Shopify
5
- VERSION = '0.53.0'
5
+ VERSION = '0.54.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid-shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.53.0
4
+ version: 0.54.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson