From dc159ed135f02e804acffa87a59962f5e8abdcf4 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 4 Jan 2022 17:44:55 -0600 Subject: [PATCH] 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. --- app/controllers/jobs_controller.rb | 2 +- app/jobs/application_job.rb | 2 +- app/models/background_job.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb index 713d80913..5ecd36a6b 100644 --- a/app/controllers/jobs_controller.rb +++ b/app/controllers/jobs_controller.rb @@ -4,7 +4,7 @@ class JobsController < ApplicationController respond_to :html, :xml, :json, :js def index - @jobs = authorize BackgroundJob.paginated_search(params) + @jobs = authorize BackgroundJob.unscoped.paginated_search(params) respond_with(@jobs) end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index 2e7cfc085..22c9b29ac 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -35,7 +35,7 @@ class ApplicationJob < ActiveJob::Base RegeneratePostJob, RetireTagRelationshipsJob, UploadPreprocessorDelayedStartJob, UploadServiceDelayedStartJob, VacuumDatabaseJob, DiscordNotificationJob, BigqueryExportJob, - ProcessBulkUpdateRequestJob, PruneJobsJob + ProcessBulkUpdateRequestJob, PruneJobsJob, ActionMailer::MailDeliveryJob ] end end diff --git a/app/models/background_job.rb b/app/models/background_job.rb index a438627fe..4b3bb9927 100644 --- a/app/models/background_job.rb +++ b/app/models/background_job.rb @@ -27,7 +27,7 @@ class BackgroundJob < GoodJob::ActiveJobJob end def name_matches(name) - class_name = name.tr(" ", "_").camelize + "Job" + class_name = name.tr(" ", "_").classify + "Job" where_json_contains(:serialized_params, { job_class: class_name }) end