mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08: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:
|
||||
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__":
|
||||
|
|
Loading…
Reference in a new issue