From d050abe53ce245029d230c9cfef3046f6ca0e04f Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 18 Oct 2022 15:05:29 +0200 Subject: [PATCH] fix(task): add begin rescue in rake task --- ..._when_termine_enabled_on_procedure_without_dossiers.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tasks/deployment/20221005142610_enable_procedure_expires_when_termine_enabled_on_procedure_without_dossiers.rake b/lib/tasks/deployment/20221005142610_enable_procedure_expires_when_termine_enabled_on_procedure_without_dossiers.rake index 9f365005d..b2dd06503 100644 --- a/lib/tasks/deployment/20221005142610_enable_procedure_expires_when_termine_enabled_on_procedure_without_dossiers.rake +++ b/lib/tasks/deployment/20221005142610_enable_procedure_expires_when_termine_enabled_on_procedure_without_dossiers.rake @@ -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