Merge pull request #7931 from betagouv/fix_enable_procedure_expires

fix(task): ajoute un controle des exception dans la tache d'action d'expiration des procedures
This commit is contained in:
LeSim 2022-10-18 15:19:48 +02:00 committed by GitHub
commit de0886e584
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,11 @@ namespace :after_party do
progress = ProgressReport.new(procedure_without_expiration.count)
procedure_without_expiration.find_each do |procedure|
if procedure.dossiers.count.zero?
procedure.update(procedure_expires_when_termine_enabled: true)
begin
procedure.update(procedure_expires_when_termine_enabled: true)
rescue StandardError => e
rake_puts "pb with procedure: #{p.id}, #{e.message}"
end
end
progress.inc
end