Merge pull request #101 from internetee/story/113066359-optimization

Story/113066359 optimization
This commit is contained in:
Timo Võhmar 2016-03-10 13:22:54 +02:00
commit 30697a3b6d
11 changed files with 92 additions and 73 deletions

View file

@ -8,17 +8,17 @@ namespace :whois do
print "\n-----> Update domains whois_records"
Domain.find_in_batches.each do |group|
UpdateWhoisRecordJob.enqueue group.map(&:id), 'domain'
UpdateWhoisRecordJob.enqueue group.map(&:name), 'domain'
end
print "\n-----> Update blocked domains whois_records"
BlockedDomain.find_in_batches.each do |group|
UpdateWhoisRecordJob.enqueue group.map(&:id), 'blocked'
UpdateWhoisRecordJob.enqueue group.map(&:name), 'blocked'
end
print "\n-----> Update reserved domains whois_records"
ReservedDomain.find_in_batches.each do |group|
UpdateWhoisRecordJob.enqueue group.map(&:id), 'reserved'
UpdateWhoisRecordJob.enqueue group.map(&:name), 'reserved'
end
end

View file

@ -23,7 +23,7 @@ namespace :zonefile do
exclude_filter := '%.%.' || i_origin;
END IF;
SELECT ROUND(extract(epoch from now() at time zone 'utc')) INTO serial_num;
SELECT (extract(epoch from now() at time zone 'utc'))::int INTO serial_num;
-- zonefile header
SELECT concat(