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

10 lines
279 B
Ruby

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