From b79933ba4c3bba6e30490f05fdc36e2853541417 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Fri, 12 Jun 2020 00:09:53 +0200 Subject: [PATCH] sleep between mailbox check --- cron.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cron.py b/cron.py index 61438e6c..1810bbdf 100644 --- a/cron.py +++ b/cron.py @@ -1,5 +1,6 @@ import argparse from dataclasses import dataclass +from time import sleep import arrow from arrow import Arrow @@ -275,6 +276,8 @@ def sanity_check(): - detect if there's mailbox that's using a invalid domain """ for mailbox in Mailbox.filter_by(verified=True).all(): + # hack to not query DNS too often + sleep(1) if not email_domain_can_be_used_as_mailbox(mailbox.email): LOG.error( "issue with mailbox %s domain. #alias %s, nb email log %s",