ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/2] incubator-ponymail git commit: More variable localisation
Date Sat, 07 Jan 2017 01:49:59 GMT
More variable localisation

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

Branch: refs/heads/master
Commit: 4d165cab2f39aceb4395b67360096fdc74ccafdb
Parents: a0b0009
Author: Sebb <sebb@apache.org>
Authored: Sat Jan 7 01:49:46 2017 +0000
Committer: Sebb <sebb@apache.org>
Committed: Sat Jan 7 01:49:46 2017 +0000

----------------------------------------------------------------------
 site/api/stats.lua | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/4d165cab/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index cd61cf7..a8f11ec 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -282,9 +282,9 @@ function handle(r)
             }
         }
     end
-    
-    local top10 = {}
-    local allparts = 0 -- number of participants
+
+--[[ ============ Completed all parameter parsing, now process the data ============ ]]
+
     -- Check for changes?
     -- Param: since=epoch (optional, defaults to now)
     if get.since then
@@ -326,8 +326,7 @@ function handle(r)
             },
             size = 1
         }
-        local h = #doc.hits.hits
-        if h == 0 then
+        if #doc.hits.hits == 0 then
             r:puts(JSON.encode{
                 changed = false,
                 took = r:clock() - tnow
@@ -335,7 +334,9 @@ function handle(r)
             return cross.OK
         end
     end
-    
+
+    local top10 = {}
+
     if config.slow_count then
         -- Debug time point 2
         table.insert(t, r:clock() - tnow)
@@ -705,6 +706,7 @@ function handle(r)
         end
     end
     
+    local allparts = 0 -- number of participants
     if not config.slow_count and not statsOnly then
         local stable = {}
         for k, v in pairs(senders) do


Mime
View raw message