From 0bb10d8fc34584fa8fba7381db66240e8961626e Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 24 Aug 2020 18:39:16 +0200 Subject: [PATCH] add spam score processing time for forward phase --- email_handler.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index 5797d28c..6844fb89 100644 --- a/email_handler.py +++ b/email_handler.py @@ -446,8 +446,15 @@ async def forward_email_to_mailbox( is_spam = False if SPAMASSASSIN_HOST: + start = time.time() spam_score = await get_spam_score(msg) - LOG.d("%s -> %s spam score %s", contact, alias, spam_score) + LOG.d( + "%s -> %s - spam score %s in %s seconds", + contact, + alias, + spam_score, + time.time() - start, + ) email_log.spam_score = spam_score db.session.commit()