sidekiq-iteration 0.4.0 → 0.4.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1d594bb1cfeb59bac823dffb9ec0d5b85063b8af421e070045a1ba280d03932
|
|
4
|
+
data.tar.gz: ecd9989d7f033b1b3d760b42854488ba2a50c3b654d95cd623b033215b1ca43d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8c866af7e7ec1ce3fc701c6695ea6c0ad8aec90c8ed94790ed274ab7a909a8e6b9dff51ec9c766af7f82c29f507bdb4f692a0446bb77e3ba4c78ea26a5f47be
|
|
7
|
+
data.tar.gz: 65a93c00c0e51a69f2339d8c5aba717e18c6530a865c66aa23eed3dbf5ecdf67513ef659e020a24b01be23dc51c5bc9716acf3a3671f78a73107281c06429f9f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Software that is designed for high availability [must be resilient](https://12fa
|
|
|
32
32
|
|
|
33
33
|
## Requirements
|
|
34
34
|
|
|
35
|
-
- Ruby 2.7+
|
|
35
|
+
- Ruby 2.7+
|
|
36
36
|
- Sidekiq 6+
|
|
37
37
|
|
|
38
38
|
## Installation
|
|
@@ -78,7 +78,7 @@ module SidekiqIteration
|
|
|
78
78
|
Enumerator.new(-> { records_size }) do |yielder|
|
|
79
79
|
while (batch = next_batch(load: true))
|
|
80
80
|
increment_iteration
|
|
81
|
-
yielder.yield(batch, cursor_value(batch.
|
|
81
|
+
yielder.yield(batch, cursor_value(batch.first))
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
end
|
|
@@ -183,11 +183,7 @@ module SidekiqIteration
|
|
|
183
183
|
|
|
184
184
|
enumerator.each do |object_from_enumerator, index|
|
|
185
185
|
found_record = true
|
|
186
|
-
around_iteration do
|
|
187
|
-
each_iteration(object_from_enumerator, *arguments)
|
|
188
|
-
end
|
|
189
186
|
@cursor_position = index
|
|
190
|
-
@current_run_iterations += 1
|
|
191
187
|
|
|
192
188
|
throttle_condition = find_throttle_condition
|
|
193
189
|
if throttle_condition
|
|
@@ -195,6 +191,11 @@ module SidekiqIteration
|
|
|
195
191
|
@needs_reenqueue = true
|
|
196
192
|
return false
|
|
197
193
|
end
|
|
194
|
+
|
|
195
|
+
around_iteration do
|
|
196
|
+
each_iteration(object_from_enumerator, *arguments)
|
|
197
|
+
end
|
|
198
|
+
@current_run_iterations += 1
|
|
198
199
|
end
|
|
199
200
|
|
|
200
201
|
unless found_record
|
|
@@ -236,9 +237,9 @@ module SidekiqIteration
|
|
|
236
237
|
raise ArgumentError, <<~MSG
|
|
237
238
|
#build_enumerator is expected to return Enumerator object, but returned #{enum.class}.
|
|
238
239
|
Example:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
Shop.find(params[
|
|
240
|
+
def build_enumerator(params, cursor:)
|
|
241
|
+
active_record_records_enumerator(
|
|
242
|
+
Shop.find(params["shop_id"]).products,
|
|
242
243
|
cursor: cursor
|
|
243
244
|
)
|
|
244
245
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sidekiq-iteration
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- fatkodima
|
|
8
8
|
- Shopify
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: sidekiq
|
|
@@ -25,7 +24,6 @@ dependencies:
|
|
|
25
24
|
- - ">="
|
|
26
25
|
- !ruby/object:Gem::Version
|
|
27
26
|
version: '6.0'
|
|
28
|
-
description:
|
|
29
27
|
email:
|
|
30
28
|
- fatkodima123@gmail.com
|
|
31
29
|
executables: []
|
|
@@ -57,7 +55,6 @@ metadata:
|
|
|
57
55
|
homepage_uri: https://github.com/fatkodima/sidekiq-iteration
|
|
58
56
|
source_code_uri: https://github.com/fatkodima/sidekiq-iteration
|
|
59
57
|
changelog_uri: https://github.com/fatkodima/sidekiq-iteration/blob/master/CHANGELOG.md
|
|
60
|
-
post_install_message:
|
|
61
58
|
rdoc_options: []
|
|
62
59
|
require_paths:
|
|
63
60
|
- lib
|
|
@@ -72,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
72
69
|
- !ruby/object:Gem::Version
|
|
73
70
|
version: '0'
|
|
74
71
|
requirements: []
|
|
75
|
-
rubygems_version:
|
|
76
|
-
signing_key:
|
|
72
|
+
rubygems_version: 4.0.3
|
|
77
73
|
specification_version: 4
|
|
78
74
|
summary: Makes your long-running sidekiq jobs interruptible and resumable.
|
|
79
75
|
test_files: []
|