pop3 catch and log exceptions

This commit is contained in:
Balakrishnan Balasubramanian 2023-06-22 00:31:05 -04:00
parent 32d5d3d557
commit 1e6655a715

View File

@ -351,10 +351,13 @@ def make_pop_server_callback(mails_path: Path, users: list[User],
State(reader=reader, writer=writer, ip=ip, req_id=scfg.next_id()))
logger.info(f"Got pop server callback")
try:
return await asyncio.wait_for(start_session(), timeout_seconds)
finally:
writer.close()
await writer.wait_closed()
try:
return await asyncio.wait_for(start_session(), timeout_seconds)
finally:
writer.close()
await writer.wait_closed()
except:
logger.exception("unexpected exception")
return session_cb