Ver Fonte

use log warning for mailbox issue

Son NK há 4 anos atrás
pai
commit
2d9abe55a4
1 ficheiros alterados com 1 adições e 3 exclusões
  1. 1 3
      cron.py

+ 1 - 3
cron.py

@@ -314,7 +314,6 @@ def sanity_check():
         if not email_domain_can_be_used_as_mailbox(mailbox.email):
         if not email_domain_can_be_used_as_mailbox(mailbox.email):
             mailbox.nb_failed_checks += 1
             mailbox.nb_failed_checks += 1
             nb_email_log = nb_email_log_for_mailbox(mailbox)
             nb_email_log = nb_email_log_for_mailbox(mailbox)
-            log_func = LOG.warning
 
 
             # send a warning
             # send a warning
             if mailbox.nb_failed_checks == 5:
             if mailbox.nb_failed_checks == 5:
@@ -333,7 +332,6 @@ def sanity_check():
 
 
             # alert if too much fail and nb_email_log > 100
             # alert if too much fail and nb_email_log > 100
             if mailbox.nb_failed_checks > 10 and nb_email_log > 100:
             if mailbox.nb_failed_checks > 10 and nb_email_log > 100:
-                log_func = LOG.exception
                 mailbox.disabled = True
                 mailbox.disabled = True
 
 
                 if mailbox.user.email != mailbox.email:
                 if mailbox.user.email != mailbox.email:
@@ -344,7 +342,7 @@ def sanity_check():
                         render("transactional/disable-mailbox.html", mailbox=mailbox),
                         render("transactional/disable-mailbox.html", mailbox=mailbox),
                     )
                     )
 
 
-            log_func(
+            LOG.warning(
                 "issue with mailbox %s domain. #alias %s, nb email log %s",
                 "issue with mailbox %s domain. #alias %s, nb email log %s",
                 mailbox,
                 mailbox,
                 mailbox.nb_alias(),
                 mailbox.nb_alias(),