Files
danbooru/app/jobs/prune_jobs_job.rb
evazion c8917684b8 jobs: fix failures in /jobs controller.
Fix errors with searching for and retrying jobs on the /jobs page caused
by the upgrade to GoodJob 3.0.
2022-08-23 18:07:04 -05:00

9 lines
241 B
Ruby

# frozen_string_literal: true
# A job that runs daily to delete all stale jobs. Spawned by {DanbooruMaintenance}.
class PruneJobsJob < ApplicationJob
def perform
BackgroundJob.where("created_at < ?", 7.days.ago).destroy_all
end
end