diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-17 09:08:02 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-17 09:08:02 +0000 |
commit | c33b396d17f653d32bea9d6a0d8874e9f894034b (patch) | |
tree | e6dc1ebafdc86d61cf53a25cacafdd78f3f5c089 /src | |
parent | 34f1c7751a55a77ce13e3166c0b53efcf373d282 (diff) | |
download | rspamd-c33b396d17f653d32bea9d6a0d8874e9f894034b.tar.gz rspamd-c33b396d17f653d32bea9d6a0d8874e9f894034b.zip |
Do not sum fuzzy stored count
Diffstat (limited to 'src')
-rw-r--r-- | src/rspamadm/fuzzy_stat.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rspamadm/fuzzy_stat.lua b/src/rspamadm/fuzzy_stat.lua index 96049540a..3b56f9c1b 100644 --- a/src/rspamadm/fuzzy_stat.lua +++ b/src/rspamadm/fuzzy_stat.lua @@ -81,7 +81,7 @@ local function sort_ips(tbl, opts) return res end -local function add_result(dst, src) +local function add_result(dst, src, k) if type(src) == 'table' then if type(dst) == 'number' then -- Convert dst to table @@ -91,7 +91,7 @@ local function add_result(dst, src) end for i,v in ipairs(src) do - if dst[i] then + if dst[i] and k ~= 'fuzzy_stored' then dst[i] = dst[i] + v else dst[i] = v @@ -99,9 +99,13 @@ local function add_result(dst, src) end else if type(dst) == 'table' then - dst[1] = dst[1] + src + if k ~= 'fuzzy_stored' then + dst[1] = dst[1] + src + else + dst[1] = src + end else - if dst then + if dst and k ~= 'fuzzy_stored' then dst = dst + src else dst = src @@ -163,7 +167,7 @@ return function(args, res) -- General stats for k,v in pairs(pr['data']) do if k ~= 'keys' then - res_db[k] = add_result(res_db[k], v) + res_db[k] = add_result(res_db[k], v, k) end end |