job-iteration 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/job-iteration/iteration.rb +10 -11
- data/lib/job-iteration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5dbb0dadbd0368e6b75a7725118d82cd49ed38d
|
4
|
+
data.tar.gz: 7a601058a648e433b30c409c76244c8ad1b71edd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a3952c608d5f087e680c31973a7617caeca9afbfb4eae80645ea3e9d9b3e11131b0c7659ef5a77086e8e0d00221620ca0015c47874d6f09b62a81ba12d26f2f
|
7
|
+
data.tar.gz: fe5fca4a552996a268d2f2b386a4cea11e4e0eaa933d00fa79fc0d2a8a967168b7e8b2f584e3c5756d9260614f87181524cdb79ee1e28227c908bfbf17898d12
|
data/Gemfile.lock
CHANGED
@@ -102,14 +102,16 @@ module JobIteration
|
|
102
102
|
ActiveSupport::Notifications.instrument("resumed.iteration", iteration_instrumentation_tags)
|
103
103
|
end
|
104
104
|
|
105
|
-
catch(:abort) do
|
106
|
-
|
105
|
+
completed = catch(:abort) do
|
106
|
+
iterate_with_enumerator(enumerator, arguments)
|
107
107
|
end
|
108
108
|
|
109
109
|
run_callbacks :shutdown
|
110
|
-
run_callbacks :complete
|
111
110
|
|
112
|
-
|
111
|
+
if completed
|
112
|
+
run_callbacks :complete
|
113
|
+
output_interrupt_summary
|
114
|
+
end
|
113
115
|
end
|
114
116
|
|
115
117
|
def iterate_with_enumerator(enumerator, arguments)
|
@@ -122,7 +124,7 @@ module JobIteration
|
|
122
124
|
|
123
125
|
next unless job_should_exit?
|
124
126
|
self.executions -= 1 if executions > 1
|
125
|
-
|
127
|
+
reenqueue_iteration_job
|
126
128
|
return false
|
127
129
|
end
|
128
130
|
|
@@ -135,7 +137,7 @@ module JobIteration
|
|
135
137
|
end
|
136
138
|
end
|
137
139
|
|
138
|
-
def
|
140
|
+
def reenqueue_iteration_job
|
139
141
|
ActiveSupport::Notifications.instrument("interrupted.iteration", iteration_instrumentation_tags)
|
140
142
|
logger.info "[JobIteration::Iteration] Interrupting and re-enqueueing the job cursor_position=#{cursor_position}"
|
141
143
|
|
@@ -143,14 +145,11 @@ module JobIteration
|
|
143
145
|
self.times_interrupted += 1
|
144
146
|
|
145
147
|
self.already_in_queue = true if respond_to?(:already_in_queue=)
|
146
|
-
|
147
|
-
retry_job unless @enqueued
|
148
|
-
|
149
|
-
true
|
148
|
+
retry_job unless @retried
|
150
149
|
end
|
151
150
|
|
152
151
|
def retry_job(*)
|
153
|
-
@
|
152
|
+
@retried = true
|
154
153
|
super
|
155
154
|
end
|
156
155
|
|
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: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|