summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-28 18:53:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-28 18:53:57 +0100
commit2eee77094a23e77df9c658883687e7ea6ec787fb (patch)
treeba7ba2dca863e55f30b3db6b7d95798879edd669 /src
parentfe83d1456e2e42a4a6025ad8b6df7c83b3529cf5 (diff)
downloadrspamd-2eee77094a23e77df9c658883687e7ea6ec787fb.tar.gz
rspamd-2eee77094a23e77df9c658883687e7ea6ec787fb.zip
[Minor] Do not touch elements that have no hits
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/maps_stats.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/maps_stats.lua b/src/plugins/lua/maps_stats.lua
index d2f094b91..ed6aedbd3 100644
--- a/src/plugins/lua/maps_stats.lua
+++ b/src/plugins/lua/maps_stats.lua
@@ -83,7 +83,9 @@ local function process_map(map, ev_base, _)
if ret and conn then
local stats = map:get_stats(true)
for k,s in pairs(stats) do
- conn:add_cmd('ZINCRBY', {key, tostring(s), k})
+ if s > 0 then
+ conn:add_cmd('ZINCRBY', {key, tostring(s), k})
+ end
end
end
end