Updates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user