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/10 17:59:07 UTC

[incubator-ponymail-foal] 02/02: trim emails before sending payload, to reduce download size

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 bc7bf3f35cc40b2197b2e039154ea209d93c399d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 10 19:58:52 2020 +0200

    trim emails before sending payload, to reduce download size
---
 server/endpoints/stats.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/server/endpoints/stats.py b/server/endpoints/stats.py
index d142aec..8ac7a02 100644
--- a/server/endpoints/stats.py
+++ b/server/endpoints/stats.py
@@ -47,6 +47,7 @@ async def process(
 
     for msg in results:
         msg["gravatar"] = plugins.mbox.gravatar(msg)
+
     wordcloud = None
     if server.config.ui.wordcloud:
         wordcloud = await plugins.mbox.wordcloud(session, query_defuzzed)
@@ -72,6 +73,10 @@ async def process(
             }
         )
 
+    # Trim email data so as to reduce download sizes
+    for msg in results:
+        plugins.mbox.trim_email(msg, external=True)
+
     return {
         "firstYear": first_year,
         "lastYear": last_year,