jobs: add ability to search jobs on /jobs page.
Add ability to search jobs on the /jobs page by job type or by status. Fixes #2577 (Search filters for delayed jobs). This wasn't possible before with DelayedJobs because it stored the job data in a YAML string, which made it difficult to search jobs by type. GoodJobs stores job data in a JSON object, which is easier to search in Postgres.
This commit is contained in:
@@ -23,4 +23,19 @@ class ApplicationJob < ActiveJob::Base
|
||||
discard_on ActiveJob::DeserializationError do |_job, error|
|
||||
DanbooruLogger.log(error)
|
||||
end
|
||||
|
||||
# A list of all available job types. Used by the /jobs search form.
|
||||
def self.job_classes
|
||||
[
|
||||
AmcheckDatabaseJob, BigqueryExportAllJob, DeleteFavoritesJob,
|
||||
DmailInactiveApproversJob, IqdbAddPostJob, IqdbRemovePostJob,
|
||||
PopulateSavedSearchJob, PruneApproversJob, PruneBansJob,
|
||||
PruneBulkUpdateRequestsJob, PrunePostDisapprovalsJob, PrunePostsJob,
|
||||
PruneRateLimitsJob, PruneUploadsJob, RegeneratePostCountsJob,
|
||||
RegeneratePostJob, RetireTagRelationshipsJob,
|
||||
UploadPreprocessorDelayedStartJob, UploadServiceDelayedStartJob,
|
||||
VacuumDatabaseJob, DiscordNotificationJob, BigqueryExportJob,
|
||||
ProcessBulkUpdateRequestJob, PruneJobsJob
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user