Class: SolidStackWeb::FailedJobs::SelectionsController
Constant Summary
ApplicationController::PERIOD_DURATIONS
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
4
5
6
7
8
9
10
|
# File 'app/controllers/solid_stack_web/failed_jobs/selections_controller.rb', line 4
def create
ids = Array(params[:job_ids]).map(&:to_i).reject(&:zero?)
SolidQueue::FailedExecution.where(id: ids).each(&:retry)
redirect_to failed_jobs_path
rescue => e
redirect_to failed_jobs_path, alert: "Could not retry jobs: #{e.message}"
end
|
#destroy ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'app/controllers/solid_stack_web/failed_jobs/selections_controller.rb', line 12
def destroy
ids = Array(params[:job_ids]).map(&:to_i).reject(&:zero?)
job_ids = SolidQueue::FailedExecution.where(id: ids).pluck(:job_id)
SolidQueue::Job.where(id: job_ids).destroy_all
redirect_to failed_jobs_path
rescue => e
redirect_to failed_jobs_path, alert: "Could not discard jobs: #{e.message}"
end
|