Class: Kuroko2::Workflow::Task::Execute
- Inherits:
-
Base
- Object
- Base
- Kuroko2::Workflow::Task::Execute
show all
- Defined in:
- lib/autoload/kuroko2/workflow/task/execute.rb
Constant Summary
collapse
- DEFAULT_EXPECTED_TIME =
60 * 24
- EXPECTED_TIME_NOTIFY_REMIND_TERM =
1.hours
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#before_execute ⇒ Object
27
28
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 27
def before_execute
end
|
#chdir ⇒ Object
30
31
32
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 30
def chdir
nil
end
|
#execute ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 8
def execute
if (execution = Execution.of(token).take)
update_execution(execution)
else
validate
token.context['CHDIR'] = chdir
before_execute
Execution.create!(token: token,
job_definition: token.job_definition,
job_instance: token.job_instance,
shell: shell,
queue: token.context['QUEUE'] || Execution::DEFAULT_QUEUE,
context: token.context)
:pass
end
end
|
#shell ⇒ Object
34
35
36
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 34
def shell
option
end
|
#validate ⇒ Object
38
39
40
41
42
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 38
def validate
if option.blank?
raise Workflow::AssertionError, "Option is required for execute"
end
end
|