Class: Barbeque::MessageHandler::JobExecution
- Inherits:
-
Object
- Object
- Barbeque::MessageHandler::JobExecution
- Defined in:
- lib/barbeque/message_handler/job_execution.rb
Instance Method Summary collapse
-
#initialize(message:, message_queue:) ⇒ JobExecution
constructor
A new instance of JobExecution.
- #run ⇒ Object
Constructor Details
#initialize(message:, message_queue:) ⇒ JobExecution
Returns a new instance of JobExecution.
10 11 12 13 |
# File 'lib/barbeque/message_handler/job_execution.rb', line 10 def initialize(message:, message_queue:) @message = @message_queue = end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/barbeque/message_handler/job_execution.rb', line 15 def run job_execution = create_job_execution begin Executor.create.start_execution(job_execution, job_envs) rescue Exception => e job_execution.update!(status: :error, finished_at: Time.now) Barbeque::ExecutionLog.save_stdout_and_stderr(job_execution, '', "#{e.class}: #{e.}\n#{e.backtrace.join("\n")}") Barbeque::SlackNotifier.notify_job_execution(job_execution) raise e end end |