This commit is contained in:
Dan Milne
2025-11-14 16:35:49 +11:00
parent df94ac9720
commit 6433f6c5bb
30 changed files with 833 additions and 245 deletions

View File

@@ -7,6 +7,27 @@ namespace :events do
Event.backfill_network_intelligence!(batch_size: batch_size)
end
desc "Backfill events with missing network intelligence (newly imported network data)"
task backfill_missing: :environment do
count = Event.where(country: nil).count
if count.zero?
puts "✓ No events missing network intelligence"
else
puts "Found #{count} events without network intelligence"
puts "Backfilling..."
processed = 0
Event.where(country: nil).find_in_batches(batch_size: 1000) do |batch|
batch.each(&:save)
processed += batch.size
puts " Processed #{processed}/#{count}"
end
puts "✓ Complete"
end
end
desc "Show backfill progress"
task backfill_progress: :environment do
total = Event.count