ductwork 0.11.2 → 0.12.0
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/ductwork/models/job.rb +1 -1
- data/lib/ductwork/models/pipeline.rb +23 -9
- data/lib/ductwork/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f31c4b527238da8b5025cad05246c99ad197fa2dd3302ebc5523e58ecbddaf5e
|
|
4
|
+
data.tar.gz: 111a5c0e4a4b45ec0c6bed50698e25eeaca9947601220f45378f1e2eb9a2f7e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '095e1453247f76378f960080fa87031a307da13b01de64e78da4d07598ae0f4da997c49f7801c4fbe6101512c235d4eb1208922e09d3acbd29ec8f2817fa197f'
|
|
7
|
+
data.tar.gz: 8f6606e82a50cbc6d847d3406d30ce18db1bf586a46dd1a44f86e80866cd9aed5ce444aa994933062e7af1d6d174c6d9c489f9cd82f6e62d96ede8357bba42cf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Ductwork Changelog
|
|
2
2
|
|
|
3
|
+
## [0.12.0]
|
|
4
|
+
|
|
5
|
+
- chore: replace usages of `Pipeline#halted!` with `Pipeline#halt!`
|
|
6
|
+
- feat: create `Ductwork::Pipeline#halt!` method
|
|
7
|
+
- chore: extract `Ductwork::Pipeline#complete!` method
|
|
8
|
+
|
|
3
9
|
## [0.11.2]
|
|
4
10
|
|
|
5
11
|
- fix: join error backtrace lines before persisting in `text` column
|
data/lib/ductwork/models/job.rb
CHANGED
|
@@ -114,6 +114,26 @@ module Ductwork
|
|
|
114
114
|
@parsed_definition ||= JSON.parse(definition).with_indifferent_access
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
def complete!
|
|
118
|
+
update!(status: :completed, completed_at: Time.current)
|
|
119
|
+
|
|
120
|
+
Ductwork.logger.info(
|
|
121
|
+
msg: "Pipeline completed",
|
|
122
|
+
pipeline_id: id,
|
|
123
|
+
role: :pipeline_advancer
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def halt!
|
|
128
|
+
halted!
|
|
129
|
+
|
|
130
|
+
Ductwork.logger.info(
|
|
131
|
+
msg: "Pipeline halted",
|
|
132
|
+
pipeline_id: id,
|
|
133
|
+
pipeline_klass: klass
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
|
|
117
137
|
private
|
|
118
138
|
|
|
119
139
|
def create_step_and_enqueue_job(edge:, input_arg:, node: nil)
|
|
@@ -148,13 +168,7 @@ module Ductwork
|
|
|
148
168
|
.exists?
|
|
149
169
|
|
|
150
170
|
if !remaining
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
Ductwork.logger.info(
|
|
154
|
-
msg: "Pipeline completed",
|
|
155
|
-
pipeline_id: id,
|
|
156
|
-
role: :pipeline_advancer
|
|
157
|
-
)
|
|
171
|
+
complete!
|
|
158
172
|
end
|
|
159
173
|
end
|
|
160
174
|
|
|
@@ -205,7 +219,7 @@ module Ductwork
|
|
|
205
219
|
end
|
|
206
220
|
|
|
207
221
|
if too_many
|
|
208
|
-
|
|
222
|
+
halt!
|
|
209
223
|
else
|
|
210
224
|
edge[:to].each do |node|
|
|
211
225
|
input_arg = Ductwork::Job.find_by(step_id:).return_value
|
|
@@ -251,7 +265,7 @@ module Ductwork
|
|
|
251
265
|
max_depth = Ductwork.configuration.steps_max_depth(pipeline: klass, step: next_klass)
|
|
252
266
|
|
|
253
267
|
if max_depth != -1 && return_value.count > max_depth
|
|
254
|
-
|
|
268
|
+
halt!
|
|
255
269
|
else
|
|
256
270
|
Array(return_value).each do |input_arg|
|
|
257
271
|
create_step_and_enqueue_job(edge:, input_arg:)
|
data/lib/ductwork/version.rb
CHANGED