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/08 16:17:37 UTC

[incubator-ponymail-foal] branch master updated (25f32c2 -> 6cd67d9)

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

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


    from 25f32c2  Add a commented-out auth_domains example
     new 3fa4d75  Only do word clouds if enabled
     new 6cd67d9  Move down, so we have a DB object before calling save_session().

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 server/endpoints/stats.py |  4 +++-
 server/plugins/session.py | 11 ++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)


[incubator-ponymail-foal] 02/02: Move down, so we have a DB object before calling save_session().

Posted by hu...@apache.org.
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 6cd67d93e115f2495cc5b70909e979f252aa3413
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 8 18:17:10 2020 +0200

    Move down, so we have a DB object before calling save_session().
---
 server/plugins/session.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/server/plugins/session.py b/server/plugins/session.py
index 087f1c7..40f64a8 100644
--- a/server/plugins/session.py
+++ b/server/plugins/session.py
@@ -111,15 +111,16 @@ async def get_session(
             del server.data.sessions[session_id]
         else:
 
-            # Do we need to update the timestamp in ES?
-            if (now - x_session.last_accessed) > FOAL_SAVE_SESSION_INTERVAL:
-                x_session.last_accessed = now
-                await save_session(x_session)
-
             # Make a copy so we don't have a race condition with the database pool object
             # In case the session is used twice within the same loop
             session = copy.copy(x_session)
             session.database = await server.dbpool.get()
+
+            # Do we need to update the timestamp in ES?
+            if (now - session.last_accessed) > FOAL_SAVE_SESSION_INTERVAL:
+                session.last_accessed = now
+                await save_session(session)
+
             return session
 
     # If not in local memory, start a new session object


[incubator-ponymail-foal] 01/02: Only do word clouds if enabled

Posted by hu...@apache.org.
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 3fa4d755cb0c962678578855c59d0826399afac2
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 8 18:16:34 2020 +0200

    Only do word clouds if enabled
---
 server/endpoints/stats.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/endpoints/stats.py b/server/endpoints/stats.py
index c9f6568..d142aec 100644
--- a/server/endpoints/stats.py
+++ b/server/endpoints/stats.py
@@ -47,7 +47,9 @@ async def process(
 
     for msg in results:
         msg["gravatar"] = plugins.mbox.gravatar(msg)
-    wordcloud = await plugins.mbox.wordcloud(session, query_defuzzed)
+    wordcloud = None
+    if server.config.ui.wordcloud:
+        wordcloud = await plugins.mbox.wordcloud(session, query_defuzzed)
     first_year, last_year = await plugins.mbox.get_years(session, query_defuzzed_nodate)
 
     tstruct, authors = await server.runners.run(plugins.mbox.construct_threads, results)