Class: SolidQueueWeb::BlockedJobsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/solid_queue_web/blocked_jobs_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::PERIOD_DURATIONS, ApplicationController::STAGGER_INTERVALS

Instance Method Summary collapse

Instance Method Details

#destroyObject



3
4
5
6
7
8
9
# File 'app/controllers/solid_queue_web/blocked_jobs_controller.rb', line 3

def destroy
  jobs = SolidQueue::BlockedExecution.includes(:job).map(&:job)
  SolidQueue::BlockedExecution.discard_all_from_jobs(jobs)
  redirect_to root_path, notice: t("solid_queue_web.flash.blocked_jobs_discarded", count: jobs.size)
rescue => e
  redirect_to root_path, alert: t("solid_queue_web.flash.cannot_discard_blocked_jobs", error: e.message)
end