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 +4 -4
- data/lib/libis/workflow/task.rb +14 -17
- data/lib/libis/workflow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5b71b6e2dc24c0ae35dd5d3391b186d2f5c12cd
|
4
|
+
data.tar.gz: 8a588d9b4ade3a58fd7c6d73e9eca833453d98f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51555a1d868759dae017bb1b456e7fa362bcdc519dddfaddab60b5e5e878eaef012e38ca337759dcd888378d9e5e94384ebb4772c558e6444e07135dd706e671
|
7
|
+
data.tar.gz: fceddf54b276796ee8fc86725a689dced75c891ff0dcd9b1a590dfd2b0296983b8c647330a2a9f2bba7e3752e3c3cf2645a8ca61d6903299ff999befc01483b1
|
data/lib/libis/workflow/task.rb
CHANGED
@@ -81,14 +81,14 @@ module Libis
|
|
81
81
|
|
82
82
|
rescue WorkflowError => e
|
83
83
|
error e.message, item
|
84
|
-
|
84
|
+
set_status item, :FAILED
|
85
85
|
|
86
86
|
rescue WorkflowAbort => e
|
87
|
-
|
87
|
+
set_status item, :FAILED
|
88
88
|
raise e if parent
|
89
89
|
|
90
90
|
rescue ::Exception => e
|
91
|
-
|
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
|
-
|
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
|
-
|
202
|
-
|
203
|
-
|
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
|
-
|
210
|
+
item_status = :ASYNC_HALT
|
209
211
|
end
|
210
212
|
|
211
|
-
if (
|
212
|
-
|
213
|
-
|
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
|
-
|
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.
|
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
|