Merge pull request #7037 from adullact/fix/7036-after-party-cloned-revisions

Échec de la tâche AfterParty fix_cloned_revisions
This commit is contained in:
LeSim 2022-03-23 11:02:02 +01:00 committed by GitHub
commit 697d60c17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ namespace :after_party do
Procedure.with_discarded.where(aasm_state: :brouillon).where.not(published_revision_id: nil).update_all(published_revision_id: nil)
begin
types_de_champ = TypeDeChamp.joins(:revision).where('types_de_champ.procedure_id != procedure_revisions.procedure_id')
progress = ProgressReport.new(types_de_champ.count)
@ -16,10 +17,14 @@ namespace :after_party do
end
progress.finish
rescue ActiveRecord::StatementInvalid, PG::UndefinedColumn => e
warn e.message
puts "Skip deploy task."
ensure
# 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
end