dynflow 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynflow/delayed_plan.rb +4 -1
- data/lib/dynflow/execution_plan.rb +4 -2
- data/lib/dynflow/execution_plan/steps/abstract.rb +1 -1
- data/lib/dynflow/execution_plan/steps/plan_step.rb +4 -3
- data/lib/dynflow/rails/daemon.rb +2 -1
- data/lib/dynflow/version.rb +1 -1
- data/lib/dynflow/web/console_helpers.rb +2 -0
- data/test/future_execution_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a92e48caa3237c278bd91fe10690740859ae29fc
|
4
|
+
data.tar.gz: 79b17f3f3119f954c58e6d2544f3a9725d51778d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58e2dab7d4634009ba158642d3959c60e2633d9ebdbe3b0c6afaa3c3b9f338868fb788e0ec4c55a9bc66032ff2e420375e496bc1c77c970edde83a57c965fe77
|
7
|
+
data.tar.gz: d9f22b6954465c5c08f9a0f9fdd059e8a9e4ebeb04f21ee2791b27597edf2b5697f7b7ee4926412b85d9095d29ff6e4c47a8258d03252745af0f2d25b9d1f233
|
data/lib/dynflow/delayed_plan.rb
CHANGED
@@ -37,7 +37,10 @@ module Dynflow
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def cancel
|
40
|
-
|
40
|
+
execution_plan.root_plan_step.state = :cancelled
|
41
|
+
execution_plan.root_plan_step.save
|
42
|
+
execution_plan.execution_history.add "Delayed task cancelled", @world.id
|
43
|
+
execution_plan.update_state :stopped
|
41
44
|
@world.persistence.delete_delayed_plans(:execution_plan_uuid => @execution_plan_uuid)
|
42
45
|
return true
|
43
46
|
end
|
@@ -54,7 +54,7 @@ module Dynflow
|
|
54
54
|
require 'dynflow/execution_plan/hooks'
|
55
55
|
|
56
56
|
def self.results
|
57
|
-
@results ||= [:pending, :success, :warning, :error]
|
57
|
+
@results ||= [:pending, :success, :warning, :error, :cancelled]
|
58
58
|
end
|
59
59
|
|
60
60
|
def self.state_transitions
|
@@ -148,7 +148,9 @@ module Dynflow
|
|
148
148
|
|
149
149
|
def result
|
150
150
|
all_steps = steps.values
|
151
|
-
if all_steps.any? { |step| step.state == :
|
151
|
+
if all_steps.any? { |step| step.state == :cancelled }
|
152
|
+
return :cancelled
|
153
|
+
elsif all_steps.any? { |step| step.state == :error }
|
152
154
|
return :error
|
153
155
|
elsif all_steps.any? { |step| [:skipping, :skipped].include?(step.state) }
|
154
156
|
return :warning
|
@@ -68,7 +68,7 @@ module Dynflow
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def self.states
|
71
|
-
@states ||= [:scheduling, :pending, :running, :success, :suspended, :skipping, :skipped, :error]
|
71
|
+
@states ||= [:scheduling, :pending, :running, :success, :suspended, :skipping, :skipped, :error, :cancelled]
|
72
72
|
end
|
73
73
|
|
74
74
|
def execute(*args)
|
@@ -59,12 +59,13 @@ module Dynflow
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.state_transitions
|
62
|
-
@state_transitions ||= { scheduling: [:pending, :error],
|
63
|
-
pending: [:running, :error],
|
64
|
-
running: [:success, :error],
|
62
|
+
@state_transitions ||= { scheduling: [:pending, :error, :cancelled],
|
63
|
+
pending: [:running, :error, :cancelled],
|
64
|
+
running: [:success, :error, :cancelled],
|
65
65
|
success: [],
|
66
66
|
suspended: [],
|
67
67
|
skipped: [],
|
68
|
+
cancelled: [],
|
68
69
|
error: [] }
|
69
70
|
end
|
70
71
|
|
data/lib/dynflow/rails/daemon.rb
CHANGED
@@ -81,7 +81,8 @@ module Dynflow
|
|
81
81
|
run(options[:rails_root], options)
|
82
82
|
rescue => e
|
83
83
|
STDERR.puts e.message
|
84
|
-
::Rails.logger.
|
84
|
+
::Rails.logger.fatal('Failed running Dynflow daemon')
|
85
|
+
::Rails.logger.fatal(e)
|
85
86
|
exit 1
|
86
87
|
end
|
87
88
|
end
|
data/lib/dynflow/version.rb
CHANGED
@@ -64,7 +64,7 @@ module Dynflow
|
|
64
64
|
execution_plan.cancel.each(&:wait)
|
65
65
|
execution_plan = world.persistence.load_execution_plan(self.execution_plan.id)
|
66
66
|
execution_plan.state.must_equal :stopped
|
67
|
-
execution_plan.result.must_equal :
|
67
|
+
execution_plan.result.must_equal :cancelled
|
68
68
|
assert_nil execution_plan.delay_record
|
69
69
|
end
|
70
70
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Necas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|