Nettoyage des dossiers préremplis abandonnés (#8341)
* Clean prefilled dossiers
This commit is contained in:
parent
82df012933
commit
d5bfe84381
1 changed files with 7 additions and 0 deletions
7
app/jobs/cron/expired_prefilled_dossiers_deletion_job.rb
Normal file
7
app/jobs/cron/expired_prefilled_dossiers_deletion_job.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
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
|
Loading…
Reference in a new issue