job-iteration 0.9.4 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1833eae2c053130cb1cb6729a33e0414683427d
4
- data.tar.gz: 7fd2d0bb197fca5453de89efbc8881d8da9abcb3
3
+ metadata.gz: b5dbb0dadbd0368e6b75a7725118d82cd49ed38d
4
+ data.tar.gz: 7a601058a648e433b30c409c76244c8ad1b71edd
5
5
  SHA512:
6
- metadata.gz: 1793c72cc520206290d7d92be1970608d51afa0fab4f74d36c7c178d0523db5c1a282029481f08250635a8f1944c66d1fc37b6984e5128a1ca0d0bc7ae6e237e
7
- data.tar.gz: f954ef4d69c5c7178dc97db6cc0e01b0ea9888d33757614e1c37f0b8f077457343470f977a95f6e17c41a01b96f5d66553255538e10a303f2661908e0a69cc0f
6
+ metadata.gz: 4a3952c608d5f087e680c31973a7617caeca9afbfb4eae80645ea3e9d9b3e11131b0c7659ef5a77086e8e0d00221620ca0015c47874d6f09b62a81ba12d26f2f
7
+ data.tar.gz: fe5fca4a552996a268d2f2b386a4cea11e4e0eaa933d00fa79fc0d2a8a967168b7e8b2f584e3c5756d9260614f87181524cdb79ee1e28227c908bfbf17898d12
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- job-iteration (0.9.4)
4
+ job-iteration (0.9.5)
5
5
  activejob (~> 5.2)
6
6
 
7
7
  GEM
@@ -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
- return unless iterate_with_enumerator(enumerator, arguments)
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
- output_interrupt_summary
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
- shutdown_and_reenqueue
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 shutdown_and_reenqueue
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
- run_callbacks :shutdown
147
- retry_job unless @enqueued
148
-
149
- true
148
+ retry_job unless @retried
150
149
  end
151
150
 
152
151
  def retry_job(*)
153
- @enqueued = true
152
+ @retried = true
154
153
  super
155
154
  end
156
155
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JobIteration
4
- VERSION = "0.9.4"
4
+ VERSION = "0.9.5"
5
5
  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: 0.9.4
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-19 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob