mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 00:48:32 +01:00
add time measures to email_handler
This commit is contained in:
parent
cba78b1b5d
commit
7e5deef34f
1 changed files with 4 additions and 1 deletions
|
@ -1122,6 +1122,7 @@ def handle(envelope: Envelope, smtp: SMTP) -> str:
|
||||||
|
|
||||||
class MailHandler:
|
class MailHandler:
|
||||||
async def handle_DATA(self, server, session, envelope: Envelope):
|
async def handle_DATA(self, server, session, envelope: Envelope):
|
||||||
|
start = time.time()
|
||||||
LOG.debug(
|
LOG.debug(
|
||||||
"===>> New message, mail from %s, rctp tos %s ",
|
"===>> New message, mail from %s, rctp tos %s ",
|
||||||
envelope.mail_from,
|
envelope.mail_from,
|
||||||
|
@ -1136,7 +1137,9 @@ class MailHandler:
|
||||||
|
|
||||||
app = new_app()
|
app = new_app()
|
||||||
with app.app_context():
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue