libis-workflow 2.0.16 → 2.0.17

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
  SHA1:
3
- metadata.gz: 00b61310a01954b0c05959bec7446bfcddcbb106
4
- data.tar.gz: 9dd4d787573e40fb33a348e5a6936569660988cc
3
+ metadata.gz: f5b71b6e2dc24c0ae35dd5d3391b186d2f5c12cd
4
+ data.tar.gz: 8a588d9b4ade3a58fd7c6d73e9eca833453d98f5
5
5
  SHA512:
6
- metadata.gz: 00376fe9680c270c1b20fd85a96512480e3111a618213365b6f1c8a72785b69722c461b21ceef896f0f8df513377479e32656fdfb4cc969d63bcafe6edd411c9
7
- data.tar.gz: 9e46ad09f53c12bc6385e3dc616f5b0a4f6f632d6ce1786b1969f6d01dc54d8f4647bd21b975868ac81fe470c4d30a4e6476d5ec4fdc8fe57ab7e206037c4766
6
+ metadata.gz: 51555a1d868759dae017bb1b456e7fa362bcdc519dddfaddab60b5e5e878eaef012e38ca337759dcd888378d9e5e94384ebb4772c558e6444e07135dd706e671
7
+ data.tar.gz: fceddf54b276796ee8fc86725a689dced75c891ff0dcd9b1a590dfd2b0296983b8c647330a2a9f2bba7e3752e3c3cf2645a8ca61d6903299ff999befc01483b1
@@ -81,14 +81,14 @@ module Libis
81
81
 
82
82
  rescue WorkflowError => e
83
83
  error e.message, item
84
- update_status item, :FAILED
84
+ set_status item, :FAILED
85
85
 
86
86
  rescue WorkflowAbort => e
87
- update_status item, :FAILED
87
+ set_status item, :FAILED
88
88
  raise e if parent
89
89
 
90
90
  rescue ::Exception => e
91
- update_status item, :FAILED
91
+ set_status item, :FAILED
92
92
  fatal "Exception occured: #{e.message}", item
93
93
  debug e.backtrace.join("\n")
94
94
 
@@ -159,7 +159,7 @@ module Libis
159
159
  set_status item, :STARTED
160
160
  self.process item
161
161
  run_subitems(item) if parameter(:recursive)
162
- update_status item, :DONE
162
+ set_status item, :DONE if item.check_status(:STARTED, self.namepath)
163
163
  else
164
164
  run_subitems(item) if parameter(:recursive)
165
165
  end
@@ -198,22 +198,24 @@ module Libis
198
198
  end
199
199
 
200
200
  def substatus_check(status, item, task_or_item)
201
- if (failed = status[:FAILED]) > 0
202
- error "%d sub#{task_or_item}(s) failed", item, failed
203
- update_status(item, :FAILED)
201
+ item_status = :DONE
202
+
203
+ if (waiting = status[:ASYNC_WAIT]) > 0
204
+ info "waiting for %d sub#{task_or_item}(s) in async process", item, waiting
205
+ item_status = :ASYNC_WAIT
204
206
  end
205
207
 
206
208
  if (halted = status[:ASYNC_HALT]) > 0
207
209
  warn "%d sub#{task_or_item}(s) halted in async process", item, halted
208
- update_status(item, :ASYNC_HALT)
210
+ item_status = :ASYNC_HALT
209
211
  end
210
212
 
211
- if (waiting = status[:ASYNC_WAIT]) > 0
212
- info "waiting for %d sub#{task_or_item}(s) in async process", item, waiting
213
- update_status(item, :ASYNC_WAIT)
213
+ if (failed = status[:FAILED]) > 0
214
+ error "%d sub#{task_or_item}(s) failed", item, failed
215
+ item_status = :FAILED
214
216
  end
215
217
 
216
- update_status(item, :DONE)
218
+ set_status(item, item_status)
217
219
  end
218
220
 
219
221
  def capture_cmd(cmd, *opts)
@@ -264,11 +266,6 @@ module Libis
264
266
  @item_skipper = true
265
267
  end
266
268
 
267
- def update_status(item, state)
268
- return nil unless item.compare_status(state, self.namepath) < 0
269
- set_status(item, state)
270
- end
271
-
272
269
  def set_status(item, state)
273
270
  item.set_status self.namepath, state
274
271
  state
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Workflow
3
- VERSION = '2.0.16' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
+ VERSION = '2.0.17' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.16
4
+ version: 2.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser