You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/07 20:04:31 UTC

[incubator-ponymail-foal] 03/10: Expand comments

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit f2cace0371a7249c58df42b2c01e94c18ce97e44
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Sep 7 21:58:38 2020 +0200

    Expand comments
---
 server/plugins/session.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/plugins/session.py b/server/plugins/session.py
index 81d7295..aae98b7 100644
--- a/server/plugins/session.py
+++ b/server/plugins/session.py
@@ -169,14 +169,16 @@ async def set_session(server: plugins.server.BaseServer, cid, **credentials):
     session = SessionObject(server, last_accessed=time.time(), cookie=session_id, cid=cid)
     session.credentials = SessionCredentials(credentials)
     server.data.sessions[session_id] = session
-    # Grab temporary DB handle
+
+    # Grab temporary DB handle since session objects at init do not have this
+    # We just need this to be able to save the session in ES.
     session.database = await server.dbpool.get()
 
     # Save session and account data
     await save_session(session)
     await save_credentials(session)
 
-    # Put DB handle back
+    # Put DB handle back into the pool
     server.dbpool.put_nowait(session.database)
     return cookie["ponymail"].OutputString()