mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Merge remote-tracking branch 'origin/master' into 104525318-history_import
# Conflicts: # Gemfile # app/models/domain.rb
This commit is contained in:
commit
34dd6af4f7
135 changed files with 4123 additions and 814 deletions
19
lib/tasks/epp.rake
Normal file
19
lib/tasks/epp.rake
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace :epp do
|
||||
|
||||
desc 'EPP actions'
|
||||
task all: :environment do
|
||||
Rake::Task['epp:trim_documents'].invoke
|
||||
end
|
||||
|
||||
desc 'Trim logs'
|
||||
task trim_documents: :environment do
|
||||
puts '-----> Running query'
|
||||
sql = <<-SQL
|
||||
UPDATE epp_logs SET request = regexp_replace(request, '<eis:legalDocument(.|\n)*?<\/eis:legalDocument>', '<eis:legalDocument>[FILTERED]<\eis:legalDocument>');
|
||||
SQL
|
||||
ApiLog::EppLog.connection.execute(sql)
|
||||
|
||||
puts "-----> Query done"
|
||||
end
|
||||
end
|
||||
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue