mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 15:14:47 +02:00
replace method of exist validation element
This commit is contained in:
parent
146f0bcdd8
commit
c59ed6d5f3
1 changed files with 4 additions and 12 deletions
|
@ -49,10 +49,6 @@ def logger
|
||||||
@logger ||= ActiveSupport::TaggedLogging.new(Syslog::Logger.new('registry'))
|
@logger ||= ActiveSupport::TaggedLogging.new(Syslog::Logger.new('registry'))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Here I set the time after which the validation is considered obsolete
|
|
||||||
# I take all contact records that have successfully passed the verification and fall within the deadline
|
|
||||||
# I am looking for contacts that have not been verified or their verification is out of date
|
|
||||||
|
|
||||||
def prepare_contacts(options)
|
def prepare_contacts(options)
|
||||||
if options[:domain_name].present?
|
if options[:domain_name].present?
|
||||||
contacts_by_domain(options[:domain_name])
|
contacts_by_domain(options[:domain_name])
|
||||||
|
@ -66,9 +62,7 @@ def prepare_contacts(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_check_level(contact)
|
def filter_check_level(contact)
|
||||||
if contact.validation_events.empty?
|
return true unless contact.validation_events.exists?
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
data = contact.validation_events.order(created_at: :asc).last
|
data = contact.validation_events.order(created_at: :asc).last
|
||||||
|
|
||||||
|
@ -99,13 +93,11 @@ def failed_contacts
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_mx_contact_validation(contact)
|
def check_mx_contact_validation(contact)
|
||||||
flag = false
|
|
||||||
data = contact.validation_events.mx.order(created_at: :asc).last(ValidationEvent::MX_CHECK)
|
data = contact.validation_events.mx.order(created_at: :asc).last(ValidationEvent::MX_CHECK)
|
||||||
if data.count >= ValidationEvent::MX_CHECK
|
|
||||||
flag = data.all? { |d| d.failed? }
|
|
||||||
end
|
|
||||||
|
|
||||||
flag
|
return false if data.size < ValidationEvent::MX_CHECK
|
||||||
|
|
||||||
|
data.all? { |d| d.failed? }
|
||||||
end
|
end
|
||||||
|
|
||||||
def contacts_by_domain(domain_name)
|
def contacts_by_domain(domain_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue