refactor
This commit is contained in:
parent
85fb859dcb
commit
f548e74e77
6
cron.py
6
cron.py
|
@ -709,8 +709,11 @@ def check_custom_domain():
|
||||||
LOG.d("Check verified domain for DNS issues")
|
LOG.d("Check verified domain for DNS issues")
|
||||||
|
|
||||||
for custom_domain in CustomDomain.filter_by(verified=True): # type: CustomDomain
|
for custom_domain in CustomDomain.filter_by(verified=True): # type: CustomDomain
|
||||||
mx_domains = get_mx_domains(custom_domain.domain)
|
check_single_custom_domain(custom_domain)
|
||||||
|
|
||||||
|
|
||||||
|
def check_single_custom_domain(custom_domain):
|
||||||
|
mx_domains = get_mx_domains(custom_domain.domain)
|
||||||
if not is_mx_equivalent(mx_domains, EMAIL_SERVERS_WITH_PRIORITY):
|
if not is_mx_equivalent(mx_domains, EMAIL_SERVERS_WITH_PRIORITY):
|
||||||
user = custom_domain.user
|
user = custom_domain.user
|
||||||
LOG.w(
|
LOG.w(
|
||||||
|
@ -745,7 +748,6 @@ def check_custom_domain():
|
||||||
else:
|
else:
|
||||||
# reset checks
|
# reset checks
|
||||||
custom_domain.nb_failed_checks = 0
|
custom_domain.nb_failed_checks = 0
|
||||||
|
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue