libis-workflow 2.1.5 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ef72c9683a7f9bebb2148f90748b4cee50a1de85dd165f9402b496f6e333a2b
4
- data.tar.gz: ff04df9816596546fea49280393dd25f72dab1c29c04a86932d5b7625808239b
3
+ metadata.gz: 27ae10e41a3a147effde1d6c4778236dc1d4e6671684d8e9b08d5b1684e01a7a
4
+ data.tar.gz: 1e21e8addccd4e08fcb795b9bfb64ff6e64e2489b9c8749ac79c3f65d475a315
5
5
  SHA512:
6
- metadata.gz: 368a2ee404589674c477bde0a252ce7df017d0cf4b25deb072caa286a53a34d141b943d870f8e2bce160a90683ee1216daf18655c41874fb95820be7c1fc1cb6
7
- data.tar.gz: '089c486d5d7bfb719be4442f5aff7c30bbd1691eb54a36e58f204bb429c79b2e2fbc21f9faafed5f0055d06ab32d34c54572126cd23bbb01b3d9993a2adad4f3'
6
+ metadata.gz: e36b676594edeba060efdc8cdabf325684c93b3c8d669188e6d4c2fe710e9fdf8c6c83c28b4fe3f1710362f799f0d3cf738410fe014f5258af68a739ea343f9d
7
+ data.tar.gz: 4c15558469b3790923aeacb1bea1da6b08bfc3b6b0c2fa871430c79f5189e05578db4d98ff4c648be3d31d39d8899bfbc6675bd3db2fc7f068a8d4f1b3462022
data/README.md CHANGED
@@ -258,7 +258,7 @@ perform on each work item:
258
258
 
259
259
  class MyTask < ::Libis::Workflow::Task
260
260
 
261
- def process_item(item)
261
+ def process(item)
262
262
  if do_something(item)
263
263
  info "Did something"
264
264
  else
@@ -274,7 +274,7 @@ perform on each work item:
274
274
  end
275
275
  ```
276
276
 
277
- As seen above, the task should define a method called process_item that takes one argument. The argument will be a
277
+ As seen above, the task should define a method called process that takes one argument. The argument will be a
278
278
  reference to the work item that it needs to perform an action on. The task has several option to progress after
279
279
  performing its actions:
280
280
  * return. This is considered a normal and successful operation result. After a successful return the item's status will
@@ -297,7 +297,7 @@ help of workflow input parameters and run options.
297
297
 
298
298
  #### Performing an action on the work item and all child items recursively
299
299
 
300
- With the 'recursive' parameter set to true, your task's process_item method will be called for the work item and then
300
+ With the 'recursive' parameter set to true, your task's process method will be called for the work item and then
301
301
  once for each child and each child's children recursively.
302
302
 
303
303
  Note: you should not make both parent and child tasks recursive as this will cause the subitems to be processed
@@ -318,7 +318,7 @@ parameter 'retry_interval', which is 30 by default.
318
318
 
319
319
  ### Pre- and postprocessing
320
320
 
321
- The default implementation of 'process' is to call 'pre_process' and then call 'process_item' on each child item,
321
+ The default implementation of running a task is to call 'pre_process' and then call 'process' for each child item,
322
322
  followed by calling 'post_process'. The methods 'pre_process' and 'post_process' are no-operation methods by default,
323
323
  but can be overwritten if needed.
324
324
 
@@ -97,8 +97,8 @@ module Libis
97
97
 
98
98
  rescue Exception => e
99
99
  set_status item, :FAILED
100
- fatal_error "Exception occured: #{e.message}", item
101
- debug e.backtrace.join("\n")
100
+ fatal_error "Aborting ingest because of error: %s @ %s\n%s", item, e.message, e.backtrace.first, e.backtrace.map{|t| ' -- ' + t}.join("\n")
101
+ raise Libis::WorkflowAbort, "#{e.message} @ #{e.backtrace.first}"
102
102
 
103
103
  ensure
104
104
  item.save!
@@ -209,7 +209,7 @@ module Libis
209
209
  break if parameter(:abort_recursion_on_failure)
210
210
 
211
211
  rescue Libis::WorkflowAbort => e
212
- fatal_error 'Fatal error processing subitem (%d/%d): %s', item, i + 1, items.size, e.message
212
+ fatal_error 'Fatal error processing subitem (%d/%d): %s @ %s\n%s', item, i + 1, items.size, e.message, e.backtrace.first, e.backtrace.map{|t| ' -- ' + t}.join("\n")
213
213
  item.set_status(namepath, :FAILED)
214
214
  break
215
215
 
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Workflow
3
- VERSION = '2.1.5' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
+ VERSION = '2.1.6' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-05 00:00:00.000000000 Z
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake