fix(job): Cron::ExpiredDossiersDeletionJob destroy brouillon expired in batch

This commit is contained in:
Colin Darie 2023-03-13 10:32:53 +01:00
parent 6a2a7fa2d0
commit 520142a9c6

View file

@ -49,7 +49,7 @@ class ExpiredDossiersDeletionService
user_notifications = group_by_user_email(Dossier.brouillon_expired)
.map { |(email, dossiers)| [email, dossiers.map(&:hash_for_deletion_mail)] }
Dossier.brouillon_expired.destroy_all
Dossier.brouillon_expired.in_batches.destroy_all
user_notifications.each do |(email, dossiers_hash)|
DossierMailer.notify_brouillon_deletion(