job-iteration 1.5.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +9 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +21 -2
- data/Gemfile.lock +63 -37
- data/guides/iteration-how-it-works.md +4 -0
- data/lib/job-iteration/active_record_batch_enumerator.rb +6 -2
- data/lib/job-iteration/active_record_enumerator.rb +4 -2
- data/lib/job-iteration/enumerator_builder.rb +10 -5
- data/lib/job-iteration/interruption_adapters/good_job_adapter.rb +30 -0
- data/lib/job-iteration/interruption_adapters/solid_queue_adapter.rb +36 -0
- data/lib/job-iteration/interruption_adapters.rb +1 -1
- data/lib/job-iteration/iteration.rb +1 -1
- data/lib/job-iteration/version.rb +1 -1
- data/lib/job-iteration.rb +9 -9
- metadata +8 -7
- data/isogun.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c3d42266a1de05ed85c35d99e76b55a131144054db3e3b83026aa3e180488c6
|
4
|
+
data.tar.gz: c272d3a7e0316cbb0a9b34326f8b1cdff5cb43c2ff58828dea1767a7f47eecb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 500cefbc1ab8e7f02a4679b13f8c1401662e63021d20b2b4b5209d979f70c208d5b2a91ed5765d5dc5739666772fbe86e6f1a3e658bd9b1dad03f4b42d97b270
|
7
|
+
data.tar.gz: 37e100ba000a3ab67a07e78937ac12c58822a13e8f5641e6a3312a49a51733da3a1d4d3c8bf1a1f1928fc45c3aa026caf003fb97565a412e4c371b389513c7bb
|
data/.github/workflows/ci.yml
CHANGED
@@ -15,29 +15,37 @@ jobs:
|
|
15
15
|
strategy:
|
16
16
|
matrix:
|
17
17
|
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
|
18
|
-
rails: ["5.2", "6.0", "6.1", "7.0", "7.1", "edge"]
|
18
|
+
rails: ["5.2", "6.0", "6.1", "7.0", "7.1", "7.2", "edge"]
|
19
19
|
gemfile: [rails_gems]
|
20
20
|
exclude:
|
21
21
|
- ruby: "2.6"
|
22
22
|
rails: "7.0"
|
23
23
|
- ruby: "2.6"
|
24
24
|
rails: "7.1"
|
25
|
+
- ruby: "2.6"
|
26
|
+
rails: "7.2"
|
25
27
|
- ruby: "2.6"
|
26
28
|
rails: "edge"
|
27
29
|
- ruby: "2.7"
|
28
30
|
rails: "7.1"
|
31
|
+
- ruby: "2.7"
|
32
|
+
rails: "7.2"
|
29
33
|
- ruby: "2.7"
|
30
34
|
rails: "edge"
|
31
35
|
- ruby: "3.0"
|
32
36
|
rails: "5.2"
|
33
37
|
- ruby: "3.0"
|
34
38
|
rails: "7.1"
|
39
|
+
- ruby: "3.0"
|
40
|
+
rails: "7.2"
|
35
41
|
- ruby: "3.0"
|
36
42
|
rails: "edge"
|
37
43
|
- ruby: "3.1"
|
38
44
|
rails: "5.2"
|
39
45
|
- ruby: "3.1"
|
40
46
|
rails: "6.0"
|
47
|
+
- ruby: "3.1"
|
48
|
+
rails: "edge"
|
41
49
|
- ruby: "3.2"
|
42
50
|
rails: "5.2"
|
43
51
|
- ruby: "3.2"
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.3
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,29 @@
|
|
1
1
|
### Main (unreleased)
|
2
|
+
|
2
3
|
Nil
|
3
4
|
|
5
|
+
## v1.7.0 (Oct 11, 2024)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
- [509](https://github.com/Shopify/job-iteration/pull/509) - Added CSV batching functionality to `EnumeratorBuilder` with `build_csv_enumerator_on_batches` method and `csv_on_batches` alias.
|
10
|
+
- [512](https://github.com/Shopify/job-iteration/pull/512) - Added support for custom timezones on `ActiveRecordEnumerator` and `ActiveRecordBatchEnumerator`. This allows for using cursors with datetime columns where `ActiveRecord.default_timezone` is set to `:local` and Active Record is not using the same timezone as the database.
|
11
|
+
|
12
|
+
## v1.6.0 (Sep 24, 2024)
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
- [464](https://github.com/Shopify/job-iteration/pull/464) - Add interruption adapter for [GoodJob](https://github.com/bensheldon/good_job).
|
17
|
+
- [505](https://github.com/Shopify/job-iteration/pull/505) - Add interruption adapter for [Solid Queue](https://github.com/rails/solid_queue).
|
18
|
+
|
4
19
|
## v1.5.1 (May 29,2024)
|
5
|
-
|
20
|
+
|
21
|
+
### Bug fixes
|
22
|
+
|
23
|
+
- [483](https://github.com/Shopify/job-iteration/pull/483) - Reverts [#456 Use Arel instead of String for AR Enumerator conditionals](https://github.com/Shopify/job-iteration/pull/456)
|
6
24
|
|
7
25
|
## v1.5.0 (May 29, 2024)
|
26
|
+
|
8
27
|
### Changes
|
9
28
|
|
10
29
|
- [437](https://github.com/Shopify/job-iteration/pull/437) - Use minimum between per-class `job_iteration_max_job_runtime` and `JobIteration.max_job_runtime`, instead of enforcing only setting decreasing values.
|
@@ -21,7 +40,7 @@ when generating position for cursor based on `:id` column (Rails 7.1 and above,
|
|
21
40
|
primary models are now supported). This ensures we grab the value of the id column, rather than a
|
22
41
|
potentially composite primary key value.
|
23
42
|
- [456](https://github.com/Shopify/job-iteration/pull/431) - Use Arel to generate SQL that's type compatible for the
|
24
|
-
cursor pagination conditionals in ActiveRecord cursor. Previously, the cursor would coerce numeric ids to a string value
|
43
|
+
cursor pagination conditionals in ActiveRecord cursor. Previously, the cursor would coerce numeric ids to a string value
|
25
44
|
(e.g.: `... AND id > '1'`)
|
26
45
|
|
27
46
|
## v1.4.1 (Sep 5, 2023)
|
data/Gemfile.lock
CHANGED
@@ -1,73 +1,92 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/brianmario/mysql2
|
3
|
-
revision:
|
3
|
+
revision: f6a9b68b42a51d1a370403f11eb88527dcb42dc6
|
4
4
|
specs:
|
5
5
|
mysql2 (0.5.6)
|
6
|
+
bigdecimal
|
6
7
|
|
7
8
|
PATH
|
8
9
|
remote: .
|
9
10
|
specs:
|
10
|
-
job-iteration (1.
|
11
|
+
job-iteration (1.7.0)
|
11
12
|
activejob (>= 5.2)
|
12
13
|
|
13
14
|
GEM
|
14
15
|
remote: https://rubygems.org/
|
15
16
|
specs:
|
16
|
-
activejob (7.
|
17
|
-
activesupport (= 7.
|
17
|
+
activejob (7.1.3.4)
|
18
|
+
activesupport (= 7.1.3.4)
|
18
19
|
globalid (>= 0.3.6)
|
19
|
-
activemodel (7.
|
20
|
-
activesupport (= 7.
|
21
|
-
activerecord (7.
|
22
|
-
activemodel (= 7.
|
23
|
-
activesupport (= 7.
|
24
|
-
|
20
|
+
activemodel (7.1.3.4)
|
21
|
+
activesupport (= 7.1.3.4)
|
22
|
+
activerecord (7.1.3.4)
|
23
|
+
activemodel (= 7.1.3.4)
|
24
|
+
activesupport (= 7.1.3.4)
|
25
|
+
timeout (>= 0.4.0)
|
26
|
+
activesupport (7.1.3.4)
|
27
|
+
base64
|
28
|
+
bigdecimal
|
25
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
|
+
connection_pool (>= 2.2.5)
|
31
|
+
drb
|
26
32
|
i18n (>= 1.6, < 2)
|
27
33
|
minitest (>= 5.1)
|
34
|
+
mutex_m
|
28
35
|
tzinfo (~> 2.0)
|
29
36
|
ast (2.4.2)
|
37
|
+
base64 (0.2.0)
|
38
|
+
bigdecimal (3.1.8)
|
30
39
|
coderay (1.1.3)
|
31
|
-
concurrent-ruby (1.
|
40
|
+
concurrent-ruby (1.3.4)
|
32
41
|
connection_pool (2.4.1)
|
33
42
|
csv (3.3.0)
|
34
|
-
|
35
|
-
|
36
|
-
|
43
|
+
drb (2.2.1)
|
44
|
+
globalid (1.2.1)
|
45
|
+
activesupport (>= 6.1)
|
46
|
+
i18n (1.14.6)
|
37
47
|
concurrent-ruby (~> 1.0)
|
38
|
-
json (2.7.
|
48
|
+
json (2.7.2)
|
39
49
|
language_server-protocol (3.17.0.3)
|
40
|
-
method_source (1.
|
41
|
-
minitest (5.
|
42
|
-
mocha (2.
|
50
|
+
method_source (1.1.0)
|
51
|
+
minitest (5.24.0)
|
52
|
+
mocha (2.4.5)
|
43
53
|
ruby2_keywords (>= 0.0.5)
|
44
54
|
mono_logger (1.1.2)
|
45
55
|
multi_json (1.15.0)
|
46
|
-
|
47
|
-
|
56
|
+
mustermann (3.0.0)
|
57
|
+
ruby2_keywords (~> 0.0.1)
|
58
|
+
mutex_m (0.2.0)
|
59
|
+
parallel (1.25.1)
|
60
|
+
parser (3.3.3.0)
|
48
61
|
ast (~> 2.4.1)
|
49
62
|
racc
|
50
63
|
pry (0.14.2)
|
51
64
|
coderay (~> 1.1)
|
52
65
|
method_source (~> 1.0)
|
53
|
-
racc (1.
|
54
|
-
rack (3.
|
66
|
+
racc (1.8.0)
|
67
|
+
rack (3.1.5)
|
68
|
+
rack-protection (4.0.0)
|
69
|
+
base64 (>= 0.1.0)
|
70
|
+
rack (>= 3.0.0, < 4)
|
71
|
+
rack-session (2.0.0)
|
72
|
+
rack (>= 3.0.0)
|
55
73
|
rainbow (3.1.1)
|
56
74
|
rake (13.2.1)
|
57
|
-
redis (5.
|
75
|
+
redis (5.3.0)
|
58
76
|
redis-client (>= 0.22.0)
|
59
|
-
redis-client (0.22.
|
77
|
+
redis-client (0.22.2)
|
60
78
|
connection_pool
|
61
79
|
redis-namespace (1.11.0)
|
62
80
|
redis (>= 4)
|
63
|
-
regexp_parser (2.9.
|
81
|
+
regexp_parser (2.9.2)
|
64
82
|
resque (2.6.0)
|
65
83
|
mono_logger (~> 1.0)
|
66
84
|
multi_json (~> 1.0)
|
67
85
|
redis-namespace (~> 1.6)
|
68
86
|
sinatra (>= 0.9.2)
|
69
|
-
rexml (3.
|
70
|
-
|
87
|
+
rexml (3.3.6)
|
88
|
+
strscan
|
89
|
+
rubocop (1.64.1)
|
71
90
|
json (~> 2.3)
|
72
91
|
language_server-protocol (>= 3.17.0)
|
73
92
|
parallel (~> 1.10)
|
@@ -78,24 +97,31 @@ GEM
|
|
78
97
|
rubocop-ast (>= 1.31.1, < 2.0)
|
79
98
|
ruby-progressbar (~> 1.7)
|
80
99
|
unicode-display_width (>= 2.4.0, < 3.0)
|
81
|
-
rubocop-ast (1.31.
|
82
|
-
parser (>= 3.3.0
|
83
|
-
rubocop-shopify (2.
|
100
|
+
rubocop-ast (1.31.3)
|
101
|
+
parser (>= 3.3.1.0)
|
102
|
+
rubocop-shopify (2.15.1)
|
84
103
|
rubocop (~> 1.51)
|
85
104
|
ruby-progressbar (1.13.0)
|
86
105
|
ruby2_keywords (0.0.5)
|
87
|
-
sidekiq (7.
|
106
|
+
sidekiq (7.2.4)
|
88
107
|
concurrent-ruby (< 2)
|
89
108
|
connection_pool (>= 2.3.0)
|
90
109
|
rack (>= 2.2.4)
|
91
|
-
redis-client (>= 0.
|
92
|
-
sinatra (
|
93
|
-
|
94
|
-
|
110
|
+
redis-client (>= 0.19.0)
|
111
|
+
sinatra (4.0.0)
|
112
|
+
mustermann (~> 3.0)
|
113
|
+
rack (>= 3.0.0, < 4)
|
114
|
+
rack-protection (= 4.0.0)
|
115
|
+
rack-session (>= 2.0.0, < 3)
|
116
|
+
tilt (~> 2.0)
|
117
|
+
sorbet-runtime (0.5.11460)
|
118
|
+
strscan (3.1.0)
|
119
|
+
tilt (2.4.0)
|
120
|
+
timeout (0.4.1)
|
95
121
|
tzinfo (2.0.6)
|
96
122
|
concurrent-ruby (~> 1.0)
|
97
123
|
unicode-display_width (2.5.0)
|
98
|
-
yard (0.9.
|
124
|
+
yard (0.9.37)
|
99
125
|
|
100
126
|
PLATFORMS
|
101
127
|
ruby
|
@@ -118,4 +144,4 @@ DEPENDENCIES
|
|
118
144
|
yard
|
119
145
|
|
120
146
|
BUNDLED WITH
|
121
|
-
2.5.
|
147
|
+
2.5.14
|
@@ -29,6 +29,10 @@ In other words, if you are trying to process 100 records but the job consistentl
|
|
29
29
|
|
30
30
|
If no retries are configured or retries are exhausted, Active Job 'bubbles up' the exception to the job backend. Retries by the backend (e.g. Sidekiq) are not supported, meaning that jobs retried by the job backend instead of Active Job will restart from the beginning.
|
31
31
|
|
32
|
+
## Stopping a job
|
33
|
+
|
34
|
+
Because jobs typically retry when exceptions are thrown, there is a special mechanism to fully stop a job that still has iterations remaining. To do this, you can `throw(:abort)`. This is then caught by job-iteration and signals that the job should complete now, regardless of its iteration state.
|
35
|
+
|
32
36
|
## Signals
|
33
37
|
|
34
38
|
It's critical to know [UNIX signals](https://www.tutorialspoint.com/unix/unix-signals-traps.htm) in order to understand how interruption works. There are two main signals that Sidekiq and Resque use: `SIGTERM` and `SIGKILL`. `SIGTERM` is the graceful termination signal which means that the process should exit _soon_, not immediately. For Iteration, it means that we have time to wait for the last iteration to finish and to push job back to the queue with the last cursor position.
|
@@ -8,8 +8,9 @@ module JobIteration
|
|
8
8
|
|
9
9
|
SQL_DATETIME_WITH_NSEC = "%Y-%m-%d %H:%M:%S.%N"
|
10
10
|
|
11
|
-
def initialize(relation, columns: nil, batch_size: 100, cursor: nil)
|
11
|
+
def initialize(relation, columns: nil, batch_size: 100, timezone: nil, cursor: nil)
|
12
12
|
@batch_size = batch_size
|
13
|
+
@timezone = timezone
|
13
14
|
@primary_key = "#{relation.table_name}.#{relation.primary_key}"
|
14
15
|
@columns = Array(columns&.map(&:to_s) || @primary_key)
|
15
16
|
@primary_key_index = @columns.index(@primary_key) || @columns.index(relation.primary_key)
|
@@ -114,7 +115,10 @@ module JobIteration
|
|
114
115
|
end
|
115
116
|
|
116
117
|
def column_value(value)
|
117
|
-
value.is_a?(Time)
|
118
|
+
return value unless value.is_a?(Time)
|
119
|
+
|
120
|
+
value = value.in_time_zone(@timezone) unless @timezone.nil?
|
121
|
+
value.strftime(SQL_DATETIME_WITH_NSEC)
|
118
122
|
end
|
119
123
|
end
|
120
124
|
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "active_record_cursor"
|
4
4
|
module JobIteration
|
5
5
|
# Builds Enumerator based on ActiveRecord Relation. Supports enumerating on rows and batches.
|
6
6
|
# @see EnumeratorBuilder
|
7
7
|
class ActiveRecordEnumerator
|
8
8
|
SQL_DATETIME_WITH_NSEC = "%Y-%m-%d %H:%M:%S.%N"
|
9
9
|
|
10
|
-
def initialize(relation, columns: nil, batch_size: 100, cursor: nil)
|
10
|
+
def initialize(relation, columns: nil, batch_size: 100, timezone: nil, cursor: nil)
|
11
11
|
@relation = relation
|
12
12
|
@batch_size = batch_size
|
13
|
+
@timezone = timezone
|
13
14
|
@columns = if columns
|
14
15
|
Array(columns)
|
15
16
|
else
|
@@ -61,6 +62,7 @@ module JobIteration
|
|
61
62
|
value = record.read_attribute(attribute.to_sym)
|
62
63
|
case record.class.columns_hash.fetch(attribute).type
|
63
64
|
when :datetime
|
65
|
+
value = value.in_time_zone(@timezone) unless @timezone.nil?
|
64
66
|
value.strftime(SQL_DATETIME_WITH_NSEC)
|
65
67
|
else
|
66
68
|
value
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
3
|
+
require_relative "active_record_batch_enumerator"
|
4
|
+
require_relative "active_record_enumerator"
|
5
|
+
require_relative "csv_enumerator"
|
6
|
+
require_relative "throttle_enumerator"
|
7
|
+
require_relative "nested_enumerator"
|
8
8
|
require "forwardable"
|
9
9
|
|
10
10
|
module JobIteration
|
@@ -144,6 +144,10 @@ module JobIteration
|
|
144
144
|
CsvEnumerator.new(enumerable).rows(cursor: cursor)
|
145
145
|
end
|
146
146
|
|
147
|
+
def build_csv_enumerator_on_batches(enumerable, cursor:, batch_size: 100)
|
148
|
+
CsvEnumerator.new(enumerable).batches(cursor: cursor, batch_size: batch_size)
|
149
|
+
end
|
150
|
+
|
147
151
|
# Builds Enumerator for nested iteration.
|
148
152
|
#
|
149
153
|
# @param enums [Array<Proc>] an Array of Procs, each should return an Enumerator.
|
@@ -186,6 +190,7 @@ module JobIteration
|
|
186
190
|
alias_method :active_record_on_batch_relations, :build_active_record_enumerator_on_batch_relations
|
187
191
|
alias_method :throttle, :build_throttle_enumerator
|
188
192
|
alias_method :csv, :build_csv_enumerator
|
193
|
+
alias_method :csv_on_batches, :build_csv_enumerator_on_batches
|
189
194
|
alias_method :nested, :build_nested_enumerator
|
190
195
|
|
191
196
|
private
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
require "good_job"
|
5
|
+
rescue LoadError
|
6
|
+
# GoodJob is not available, no need to load the adapter
|
7
|
+
return
|
8
|
+
end
|
9
|
+
|
10
|
+
begin
|
11
|
+
# GoodJob.current_thread_shutting_down? was introduced in GoodJob 3.26
|
12
|
+
gem("good_job", ">= 3.26")
|
13
|
+
rescue Gem::LoadError
|
14
|
+
warn("job-iteration's interruption adapter for GoodJob requires GoodJob 3.26 or newer")
|
15
|
+
return
|
16
|
+
end
|
17
|
+
|
18
|
+
module JobIteration
|
19
|
+
module InterruptionAdapters
|
20
|
+
module GoodJobAdapter
|
21
|
+
class << self
|
22
|
+
def call
|
23
|
+
!!::GoodJob.current_thread_shutting_down?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
register(:good_job, GoodJobAdapter)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
require "solid_queue"
|
5
|
+
rescue LoadError
|
6
|
+
# SolidQueue is not available, no need to load the adapter
|
7
|
+
return
|
8
|
+
end
|
9
|
+
|
10
|
+
begin
|
11
|
+
# SolidQueue.on_worker_stop was introduced in SolidQueue 0.7.1
|
12
|
+
gem("solid_queue", ">= 0.7.1")
|
13
|
+
rescue Gem::LoadError
|
14
|
+
warn("job-iteration's interruption adapter for SolidQueue requires SolidQueue 0.7.1 or newer")
|
15
|
+
return
|
16
|
+
end
|
17
|
+
|
18
|
+
module JobIteration
|
19
|
+
module InterruptionAdapters
|
20
|
+
module SolidQueueAdapter
|
21
|
+
class << self
|
22
|
+
attr_accessor :stopping
|
23
|
+
|
24
|
+
def call
|
25
|
+
stopping
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
SolidQueue.on_worker_stop do
|
30
|
+
SolidQueueAdapter.stopping = true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
register(:solid_queue, SolidQueueAdapter)
|
35
|
+
end
|
36
|
+
end
|
@@ -4,7 +4,7 @@ require_relative "interruption_adapters/null_adapter"
|
|
4
4
|
|
5
5
|
module JobIteration
|
6
6
|
module InterruptionAdapters
|
7
|
-
BUNDLED_ADAPTERS = [:resque, :sidekiq].freeze # @api private
|
7
|
+
BUNDLED_ADAPTERS = [:good_job, :resque, :sidekiq, :solid_queue].freeze # @api private
|
8
8
|
|
9
9
|
class << self
|
10
10
|
# Returns adapter for specified name.
|
@@ -14,7 +14,7 @@ module JobIteration
|
|
14
14
|
# The time when the job starts running. If the job is interrupted and runs again, the value is updated.
|
15
15
|
attr_accessor :start_time
|
16
16
|
|
17
|
-
# The total time the job has been running, including multiple iterations.
|
17
|
+
# The total time (in seconds) the job has been running, including multiple iterations.
|
18
18
|
# The time isn't reset if the job is interrupted.
|
19
19
|
attr_accessor :total_time
|
20
20
|
|
data/lib/job-iteration.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "active_job"
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
8
|
-
require_relative "
|
9
|
-
require_relative "
|
4
|
+
require_relative "job-iteration/version"
|
5
|
+
require_relative "job-iteration/enumerator_builder"
|
6
|
+
require_relative "job-iteration/interruption_adapters"
|
7
|
+
require_relative "job-iteration/iteration"
|
8
|
+
require_relative "job-iteration/log_subscriber"
|
9
|
+
require_relative "job-iteration/railtie"
|
10
10
|
|
11
11
|
module JobIteration
|
12
12
|
Deprecation = ActiveSupport::Deprecation.new("2.0", "JobIteration")
|
@@ -62,9 +62,9 @@ module JobIteration
|
|
62
62
|
# Overrides interruption checks based on queue adapter.
|
63
63
|
# @deprecated - Use JobIteration::InterruptionAdapters.register(:foo, callable) instead.
|
64
64
|
def interruption_adapter=(adapter)
|
65
|
-
Deprecation.warn("Setting JobIteration.interruption_adapter is deprecated. "\
|
66
|
-
"Use JobIteration::InterruptionAdapters.register(:foo, callable) instead "\
|
67
|
-
"to register the callable (a proc, method, or other object responding to #call) "\
|
65
|
+
Deprecation.warn("Setting JobIteration.interruption_adapter is deprecated. " \
|
66
|
+
"Use JobIteration::InterruptionAdapters.register(:foo, callable) instead " \
|
67
|
+
"to register the callable (a proc, method, or other object responding to #call) " \
|
68
68
|
"as the interruption adapter for queue adapter :foo.")
|
69
69
|
@interruption_adapter = adapter
|
70
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: job-iteration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -54,7 +54,6 @@ files:
|
|
54
54
|
- guides/custom-enumerator.md
|
55
55
|
- guides/iteration-how-it-works.md
|
56
56
|
- guides/throttling.md
|
57
|
-
- isogun.yml
|
58
57
|
- job-iteration.gemspec
|
59
58
|
- lib/job-iteration.rb
|
60
59
|
- lib/job-iteration/active_record_batch_enumerator.rb
|
@@ -63,9 +62,11 @@ files:
|
|
63
62
|
- lib/job-iteration/csv_enumerator.rb
|
64
63
|
- lib/job-iteration/enumerator_builder.rb
|
65
64
|
- lib/job-iteration/interruption_adapters.rb
|
65
|
+
- lib/job-iteration/interruption_adapters/good_job_adapter.rb
|
66
66
|
- lib/job-iteration/interruption_adapters/null_adapter.rb
|
67
67
|
- lib/job-iteration/interruption_adapters/resque_adapter.rb
|
68
68
|
- lib/job-iteration/interruption_adapters/sidekiq_adapter.rb
|
69
|
+
- lib/job-iteration/interruption_adapters/solid_queue_adapter.rb
|
69
70
|
- lib/job-iteration/iteration.rb
|
70
71
|
- lib/job-iteration/log_subscriber.rb
|
71
72
|
- lib/job-iteration/nested_enumerator.rb
|
@@ -79,7 +80,7 @@ licenses:
|
|
79
80
|
metadata:
|
80
81
|
changelog_uri: https://github.com/Shopify/job-iteration/blob/main/CHANGELOG.md
|
81
82
|
allowed_push_host: https://rubygems.org
|
82
|
-
post_install_message:
|
83
|
+
post_install_message:
|
83
84
|
rdoc_options: []
|
84
85
|
require_paths:
|
85
86
|
- lib
|
@@ -94,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
95
|
- !ruby/object:Gem::Version
|
95
96
|
version: '0'
|
96
97
|
requirements: []
|
97
|
-
rubygems_version: 3.5.
|
98
|
-
signing_key:
|
98
|
+
rubygems_version: 3.5.21
|
99
|
+
signing_key:
|
99
100
|
specification_version: 4
|
100
101
|
summary: Makes your background jobs interruptible and resumable.
|
101
102
|
test_files: []
|