demarches-normaliennes/app/jobs/cron/purge_stale_archives_job.rb
2024-08-22 09:26:48 +02:00

10 lines
273 B
Ruby

# frozen_string_literal: true
class Cron::PurgeStaleArchivesJob < Cron::CronJob
self.schedule_expression = "every 5 minutes"
def perform
Archive.stale(Archive::RETENTION_DURATION).destroy_all
Archive.stuck(Archive::MAX_DUREE_GENERATION).destroy_all
end
end