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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aeafd6691af4722e01b18aefa76b2bd5ae75abe5930e0d7ab1a43593aba80010
4
- data.tar.gz: 15ad867b7f98d0e3372b3e9f5a960964305df8f16da48a7273c4413f73f58c76
3
+ metadata.gz: f31c4b527238da8b5025cad05246c99ad197fa2dd3302ebc5523e58ecbddaf5e
4
+ data.tar.gz: 111a5c0e4a4b45ec0c6bed50698e25eeaca9947601220f45378f1e2eb9a2f7e2
5
5
  SHA512:
6
- metadata.gz: 2a7df95cb4335e77d71f08bdfa1d0bb029fc651f458a129d4ccfd7b447d484fe780517a5e64280f242a0e52a6414385bdbb5b45bb14417c96d39d9fb017936c5
7
- data.tar.gz: c9d5d363580913ca51869a7ff8df6d2c02dae61de6aa064eac2f8c9ab5f7199b0ed91f2858fe7c8ea62d110f7e201e0cf2ba60cf202b294c7c729a3e8dc75802
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
@@ -178,7 +178,7 @@ module Ductwork
178
178
  halted = true
179
179
 
180
180
  step.update!(status: :failed)
181
- pipeline.halted!
181
+ pipeline.halt!
182
182
  end
183
183
  end
184
184
 
@@ -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
- update!(status: :completed, completed_at: Time.current)
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
- halted!
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
- halted!
268
+ halt!
255
269
  else
256
270
  Array(return_value).each do |input_arg|
257
271
  create_step_and_enqueue_job(edge:, input_arg:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductwork
4
- VERSION = "0.11.2"
4
+ VERSION = "0.12.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ductwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing