Merge pull request #9194 from demarches-simplifiees/fix-replay-routing-engine

Correction : rejoue le routing engine apres ajout des règles de routage sur une procédure clonée
This commit is contained in:
Eric Leroy-Terquem 2023-06-13 14:08:56 +00:00 committed by GitHub
commit 92bdab3de4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,25 @@
namespace :after_party do
desc 'Deployment task: replay_routing_engine_for_a_cloned_procedure'
task replay_routing_engine_for_a_cloned_procedure: :environment do
puts "Running deploy task 'replay_routing_engine_for_a_cloned_procedure'"
# Put your task implementation HERE.
dossiers = Procedure
.find(76266)
.dossiers
.en_construction
progress = ProgressReport.new(dossiers.count)
dossiers.find_each do |dossier|
RoutingEngine.compute(dossier)
progress.inc
end
progress.finish
# 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).
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end