jobs: switch from DelayedJob to GoodJob.
Switch the ActiveJob backend from DelayedJob to GoodJob. Differences: * The job worker is run with `bin/good_job start` instead of `bin/delayed_job`. * Jobs have an 8 hour timeout instead of a 4 hour timeout. * Jobs don't automatically retry on failure. * Finishing jobs are preserved and pruned after 7 days.
This commit is contained in:
8
app/jobs/prune_jobs_job.rb
Normal file
8
app/jobs/prune_jobs_job.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A job that runs daily to delete all stale jobs. Spawned by {DanbooruMaintenance}.
|
||||
class PruneJobsJob < ApplicationJob
|
||||
def perform
|
||||
GoodJob::ActiveJobJob.where("created_at < ?", 7.days.ago).destroy_all
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user