Sfoglia il codice sorgente

log waiting time for get_spam_score

Son NK 4 anni fa
parent
commit
ffa9304d00
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      email_handler.py

+ 8 - 1
email_handler.py

@@ -611,8 +611,15 @@ async def handle_reply(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> (boo
 
     # do not use user.max_spam_score here
     if SPAMASSASSIN_HOST:
+        start = time.time()
         spam_score = await get_spam_score(msg)
-        LOG.d("%s -> %s - spam score %s", alias, contact, spam_score)
+        LOG.d(
+            "%s -> %s - spam score %s in %s seconds",
+            alias,
+            contact,
+            spam_score,
+            time.time() - start,
+        )
         email_log.spam_score = spam_score
         if spam_score > MAX_REPLY_PHASE_SPAM_SCORE:
             is_spam = True