Class: RuoteNATS::ShellExecutor
- Inherits:
-
Object
- Object
- RuoteNATS::ShellExecutor
- Defined in:
- lib/ruote-nats/shell_executor.rb
Instance Method Summary collapse
-
#execute(workitem) ⇒ Hash
Execute shell command.
Instance Method Details
#execute(workitem) ⇒ Hash
Execute shell command
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruote-nats/shell_executor.rb', line 8 def execute(workitem) if workitem.lookup('params.command') out, status = invoke(workitem) if status.success? { out: out, status: status.exitstatus, finished_at: Ruote.now_to_utc_s } else raise "out: #{out}, status: #{status.exitstatus}, finished_at: #{Ruote.now_to_utc_s}" end else workitem.result = 'failure' = 'command is not specified, check your process definition' RuoteNATS.logger.error do "(#{workitem.sid}) shell: #{}" end raise end end |