Skip to content

Commit

Permalink
correctif(dossiers.expirations): sur de gros volumes de données, le f…
Browse files Browse the repository at this point in the history
…ait de mettre a jours tous les dossiers a supprime timeout face a PG. batch la maj
  • Loading branch information
Martin committed Jun 20, 2023
1 parent 2cfa5a9 commit 8a42aa2
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 8a42aa2

Please sign in to comment.