Files
danbooru/app/controllers/jobs_controller.rb
evazion dc159ed135 jobs: show retried jobs in /jobs listing.
Fix the /jobs listing to show retried jobs. GoodJob::ActiveJobJob has a
default scope that filters out retried jobs; remove it in the index
controller so we can see retried jobs.

Also fix mail delivery jobs not showing up in the dropdown in the /jobs
search form.
2022-01-04 17:46:54 -06:00

35 lines
704 B
Ruby

# frozen_string_literal: true
class JobsController < ApplicationController
respond_to :html, :xml, :json, :js
def index
@jobs = authorize BackgroundJob.unscoped.paginated_search(params)
respond_with(@jobs)
end
def cancel
@job = authorize BackgroundJob.find(params[:id])
@job.discard_job("Canceled")
respond_with(@job)
end
def retry
@job = authorize BackgroundJob.find(params[:id])
@job.retry_job
respond_with(@job)
end
def run
@job = authorize BackgroundJob.find(params[:id])
@job.reschedule_job
respond_with(@job)
end
def destroy
@job = authorize BackgroundJob.find(params[:id])
@job.destroy
respond_with(@job)
end
end