mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
16 lines
536 B
Ruby
16 lines
536 B
Ruby
class DomainUpdateConfirmJob < Que::Job
|
|
def run(domain_id, action)
|
|
# it's recommended to keep transaction against job table as short as possible.
|
|
ActiveRecord::Base.transaction do
|
|
domain = Epp::Domain.find(domain_id)
|
|
case action
|
|
when RegistrantVerification::CONFIRMED
|
|
domain.apply_pending_update!
|
|
domain.clean_pendings!
|
|
when RegistrantVerification::REJECTED
|
|
domain.clean_pendings!
|
|
end
|
|
destroy # it's best to destroy the job in the same transaction
|
|
end
|
|
end
|
|
end
|