Files
danbooru/app/logical/danbooru_maintenance.rb
evazion f4953549ae 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.
2022-01-04 13:52:08 -06:00

42 lines
866 B
Ruby

# frozen_string_literal: true
module DanbooruMaintenance
module_function
def hourly
queue PruneUploadsJob
queue PrunePostsJob
queue PruneRateLimitsJob
queue RegeneratePostCountsJob
#queue AmcheckDatabaseJob
end
def daily
queue PruneJobsJob
queue PrunePostDisapprovalsJob
queue PruneBulkUpdateRequestsJob
queue PruneBansJob
queue BigqueryExportAllJob
queue VacuumDatabaseJob
end
def weekly
queue RetireTagRelationshipsJob
queue DmailInactiveApproversJob
end
def monthly
queue PruneApproversJob
end
def queue(job)
Rails.logger.level = :info
DanbooruLogger.info("Queueing #{job.name}")
ApplicationRecord.connection.verify!
job.perform_later
rescue Exception => e # rubocop:disable Lint/RescueException
DanbooruLogger.log(e)
raise e if Rails.env.test?
end
end