demarches-normaliennes/app/jobs/cron/expired_prefilled_dossiers_deletion_job.rb
Damien Le Thiec d5bfe84381
Nettoyage des dossiers préremplis abandonnés (#8341)
* Clean prefilled dossiers
2023-01-12 16:14:42 +01:00

7 lines
234 B
Ruby

class Cron::ExpiredPrefilledDossiersDeletionJob < Cron::CronJob
self.schedule_expression = "every day at 3:00"
def perform
Dossier.prefilled.state_brouillon.where(user_id: nil, updated_at: ..5.days.ago).destroy_all
end
end