mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +02:00
12 lines
403 B
Ruby
12 lines
403 B
Ruby
class RegenerateRegistrarWhoisesJob < ApplicationJob
|
|
retry_on StandardError, wait: 2.seconds, attempts: 3
|
|
|
|
def perform(registrar_id)
|
|
# no return as we want restart job if fails
|
|
registrar = Registrar.find(registrar_id)
|
|
|
|
registrar.whois_records.select(:name).find_in_batches(batch_size: 20) do |group|
|
|
UpdateWhoisRecordJob.perform_later group.map(&:name), 'domain'
|
|
end
|
|
end
|
|
end
|