From 7e5deef34fe043b7d529594a392bb381aeed0391 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Tue, 11 Aug 2020 17:32:04 +0200 Subject: [PATCH] add time measures to email_handler --- email_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index d2936996..9bd4a90f 100644 --- a/email_handler.py +++ b/email_handler.py @@ -1122,6 +1122,7 @@ def handle(envelope: Envelope, smtp: SMTP) -> str: class MailHandler: async def handle_DATA(self, server, session, envelope: Envelope): + start = time.time() LOG.debug( "===>> New message, mail from %s, rctp tos %s ", envelope.mail_from, @@ -1136,7 +1137,9 @@ class MailHandler: app = new_app() with app.app_context(): - return handle(envelope, smtp) + ret = handle(envelope, smtp) + LOG.debug("takes %s seconds <<===", time.time() - start) + return ret if __name__ == "__main__":