Merge pull request #6926 from adullact/fix/6884-afterparty-rename-conservation-extension

[AfterParty] échec de la tâche 20210429172327_rename_conservation_extension
This commit is contained in:
Paul Chavard 2022-02-08 12:00:50 +01:00 committed by GitHub
commit 537112acee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,9 @@ namespace :after_party do
BATCH_SIZE = 20_000
ignored_columns = Dossier.ignored_columns.dup
Dossier.ignored_columns -= ["en_construction_conservation_extension"]
dossiers = Dossier.state_en_construction.where.not(en_construction_conservation_extension: 0.days)
progress = ProgressReport.new((dossiers.count.to_f / BATCH_SIZE).round)
dossiers.in_batches(of: BATCH_SIZE) do |relation|
@ -13,6 +16,8 @@ namespace :after_party do
end
progress.finish
Dossier.ignored_columns = ignored_columns
dossiers_without_conservation_extension = Dossier.where(conservation_extension: nil)
progress = ProgressReport.new((dossiers_without_conservation_extension.count.to_f / BATCH_SIZE).round)
dossiers_without_conservation_extension.in_batches(of: BATCH_SIZE) do |relation|