Merge pull request #7029 from adullact/fix/7028-after-party-process-expired

Échec de la tâche AfterParty process_expired_dossiers_en_construction
This commit is contained in:
LeSim 2022-03-16 18:15:32 +01:00 committed by GitHub
commit 9d5db6e276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,12 +3,11 @@ namespace :after_party do
task process_expired_dossiers_en_construction: :environment do task process_expired_dossiers_en_construction: :environment do
puts "Running deploy task 'process_expired_dossiers_en_construction'" puts "Running deploy task 'process_expired_dossiers_en_construction'"
if ENV['APP_NAME'] == 'tps'
dossiers_close_to_expiration = Dossier dossiers_close_to_expiration = Dossier
.en_construction_close_to_expiration .en_construction_close_to_expiration
.without_en_construction_expiration_notice_sent .without_en_construction_expiration_notice_sent
ExpiredDossiersDeletionService.send_expiration_notices(dossiers_close_to_expiration) ExpiredDossiersDeletionService.send_expiration_notices(dossiers_close_to_expiration, :en_construction_close_to_expiration_notice_sent_at)
BATCH_SIZE = 1000 BATCH_SIZE = 1000
@ -18,7 +17,6 @@ namespace :after_party do
.limit(BATCH_SIZE) .limit(BATCH_SIZE)
.update_all(en_construction_close_to_expiration_notice_sent_at: Time.zone.now + n.days) .update_all(en_construction_close_to_expiration_notice_sent_at: Time.zone.now + n.days)
end end
end
# Update task as completed. If you remove the line below, the task will # Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run). # run with every deploy (or every time you call after_party:run).