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:
commit
537112acee
1 changed files with 5 additions and 0 deletions
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue