Skip to content

Commit

Permalink
Merge pull request demarches-simplifiees#9220 from mfo/US/fix-expirat…
Browse files Browse the repository at this point in the history
…ion-job

correctif(dossiers.expirations): sur de gros volumes de données, le fait de mettre a jours tous les dossiers a supprime timeout face a PG. batch la maj
  • Loading branch information
colinux authored Jun 21, 2023
2 parents 7f0f735 + 8a42aa2 commit 508b3c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/expired_dossiers_deletion_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def self.send_expiration_notices(dossiers_close_to_expiration, close_to_expirati
user_notifications = group_by_user_email(dossiers_close_to_expiration)
administration_notifications = group_by_fonctionnaire_email(dossiers_close_to_expiration)

dossiers_close_to_expiration.update_all(close_to_expiration_flag => Time.zone.now)
dossiers_close_to_expiration.in_batches.update_all(close_to_expiration_flag => Time.zone.now)

user_notifications.each do |(email, dossiers)|
DossierMailer.notify_near_deletion_to_user(dossiers, email).deliver_later
Expand Down

0 comments on commit 508b3c3

Please sign in to comment.