add time measures to email_handler

This commit is contained in:
Son NK 2020-08-11 17:32:04 +02:00
parent cba78b1b5d
commit 7e5deef34f

View file

@ -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__":