Merge remote-tracking branch 'origin/master' into 105846070-merge-with-105842700-arireg-for-registrant-port

# Conflicts:
#	app/models/domain.rb
This commit is contained in:
Vladimir Krylov 2016-02-15 10:11:07 +02:00
commit afd3b06f62
94 changed files with 2001 additions and 720 deletions

View file

@ -3,15 +3,24 @@ namespace :whois do
task regenerate: :environment do
start = Time.zone.now.to_f
@i = 0
print "-----> Regenerate Registry whois_records table and sync with whois server..."
ActiveRecord::Base.uncached do
puts "\n#{@i}"
Domain.included.find_in_batches(batch_size: 10000) do |batch|
batch.map(&:update_whois_record)
puts(@i += 10000)
GC.start
print "\n-----> Update domains whois_records"
Domain.find_in_batches.each do |group|
UpdateWhoisRecordJob.enqueue group.map(&:id), 'domain'
end
print "\n-----> Update blocked domains whois_records"
BlockedDomain.find_in_batches.each do |group|
UpdateWhoisRecordJob.enqueue group.map(&:id), 'blocked'
end
print "\n-----> Update reserved domains whois_records"
ReservedDomain.find_in_batches.each do |group|
UpdateWhoisRecordJob.enqueue group.map(&:id), 'reserved'
end
end
puts "\n-----> all done in #{(Time.zone.now.to_f - start).round(2)} seconds"
end