demarches-normaliennes/app/jobs/cron/purge_stale_archives_job.rb

7 lines
181 B
Ruby

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