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

7 lines
189 B
Ruby

class Cron::PurgeStaleExportsJob < Cron::CronJob
self.schedule_expression = "every 5 minutes"
def perform
Export.stale(Export::MAX_DUREE_CONSERVATION_EXPORT).destroy_all
end
end