Merge pull request #8756 from colinux/fix-cron-expired-dossiers-brouillon

fix(job): ExpiredDossiersDeletionJob détruit en batch les dossiers en brouillon expirés
This commit is contained in:
LeSim 2023-03-14 12:35:41 +00:00 committed by GitHub
commit 2d203d6461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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(