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