move all the cron jobs in a dedicated directory

This commit is contained in:
clemkeirua 2020-11-13 14:34:53 +01:00 committed by LeSim (Rebase PR Action)
parent 977736e5d4
commit 513d4f6ff1
23 changed files with 34 additions and 34 deletions

View file

@ -0,0 +1,9 @@
class Cron::PurgeUnattachedBlobsJob < Cron::CronJob
self.schedule_expression = "every day at midnight"
def perform(*args)
ActiveStorage::Blob.unattached
.where('active_storage_blobs.created_at < ?', 24.hours.ago)
.find_each(&:purge_later)
end
end