You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2017/01/05 13:22:41 UTC

incubator-ponymail git commit: Drop the unused commented code

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master d78ebeea4 -> 85eaeabd5


Drop the unused commented code

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/85eaeabd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/85eaeabd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/85eaeabd

Branch: refs/heads/master
Commit: 85eaeabd55cb66728e657f76b66791ed3f6065ae
Parents: d78ebee
Author: Sebb <se...@apache.org>
Authored: Thu Jan 5 13:22:33 2017 +0000
Committer: Sebb <se...@apache.org>
Committed: Thu Jan 5 13:22:33 2017 +0000

----------------------------------------------------------------------
 site/api/pminfo.lua | 48 +++---------------------------------------------
 1 file changed, 3 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/85eaeabd/site/api/pminfo.lua
----------------------------------------------------------------------
diff --git a/site/api/pminfo.lua b/site/api/pminfo.lua
index d05c536..7f95ff3 100644
--- a/site/api/pminfo.lua
+++ b/site/api/pminfo.lua
@@ -68,12 +68,6 @@ function handle(r)
         size = 0, -- we don't need the hits themselves
         query = QUERY,
         aggs = {
---            lists = { -- active lists (needed?)
---                terms = {
---                    field = "list_raw",
---                    size = MAXRESULTS
---                }
---            },
             nlists = { -- total active lists
                 cardinality = {
                     field = "list_raw"
@@ -89,26 +83,11 @@ function handle(r)
                     field = "date",
                     interval = "1d"
                 }
---            },
---            top100 = { -- top100 senders (needed?)
---                terms = {
---                    field = "from_raw",
---                    size = 100
---                }
             }
         }
     }
---    local lists = {} -- TODO unused?
-    local nal = doc.aggregations.nlists.value -- This *is* used
 
---    for x,y in pairs (doc.aggregations.lists.buckets) do
---        local list, domain = y.key:match("^<?(.-)%.(.-)>?$")
---        if not domain:match("%..-%..-%..-") and domain:match("^[-_a-z0-9.]+$") and list:match("^[-_a-z0-9.]+$") then
---            lists[domain] = lists[domain] or {}
---            lists[domain][list] = y.doc_count
---            nal = nal + 1
---        end
---    end
+    local nal = doc.aggregations.nlists.value -- number of active lists
     
     -- Debug time point 2
     
@@ -122,30 +101,11 @@ function handle(r)
     for k, v in pairs (doc.aggregations.weekly.buckets) do
         table.insert(activity, {v.key, v.doc_count})
     end
-    
---    local active_senders = {} -- TODO unused?
-    
-    
-    
+        
     -- Debug time point 3
     table.insert(t, r:clock() - tnow)
     tnow = r:clock()
-    
---    for x,y in pairs (doc.aggregations.top100.buckets) do
---        local eml = y.key:match("<(.-)>") or y.key:match("%S+@%S+") or "unknown"
---        local gravatar = r:md5(eml)
---        local name = y.key:match("([^<]+)%s*<.->") or y.key:match("%S+@%S+") or eml
---        name = name:gsub("\"", "")
---        table.insert(active_senders, {
---            id = y.key,
---            email = eml,
---            gravatar = gravatar,
---            name = name,
---            count = y.doc_count
---        })
---    end
-
-    
+        
     -- Debug time point 4
     table.insert(t, r:clock() - tnow)
     tnow = r:clock()
@@ -250,9 +210,7 @@ function handle(r)
     listdata.no_threads = num_threads
     listdata.hits = h
     listdata.participants = no_senders
---    listdata.top100 = active_senders -- TODO unused by callers?
     listdata.no_active_lists = nal
---    listdata.active_lists = lists -- TODO unused by callers?
     listdata.took = r:clock() - now
     listdata.activity = activity