Class: Barbeque::JobExecutionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Barbeque::JobExecutionsController
- Defined in:
- app/controllers/barbeque/job_executions_controller.rb
Constant Summary collapse
- ID_REGEXP =
/\A[0-9]+\z/
Instance Method Summary collapse
Instance Method Details
#retry ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/barbeque/job_executions_controller.rb', line 20 def retry @job_execution = Barbeque::JobExecution.find_by!(message_id: params[:job_execution_message_id]) raise ActionController::BadRequest unless @job_execution.retryable? result = Barbeque::MessageRetryingService.new(message_id: @job_execution.).run @job_execution.retried! redirect_to @job_execution, notice: "Succeed to retry (message_id=#{result.})" end |
#show ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/barbeque/job_executions_controller.rb', line 4 def show if ID_REGEXP === params[:message_id] job_execution = Barbeque::JobExecution.find_by(id: params[:message_id]) if job_execution redirect_to(job_execution) return end end @job_execution = Barbeque::JobExecution.find_by!(message_id: params[:message_id]) # Return 404 when job_definition or app is deleted @job_definition = Barbeque::JobDefinition.find(@job_execution.job_definition_id) @app = Barbeque::App.find(@job_definition.app_id) @log = @job_execution.execution_log @job_retries = @job_execution.job_retries.order(id: :desc) end |