From: Vsevolod Stakhov Date: Sat, 28 Apr 2018 17:53:57 +0000 (+0100) Subject: [Minor] Do not touch elements that have no hits X-Git-Tag: 1.7.4~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2eee77094a23e77df9c658883687e7ea6ec787fb;p=rspamd.git [Minor] Do not touch elements that have no hits --- 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