aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-07-31 14:54:13 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-07-31 14:54:13 +0200
commitae5d1eff5de3951a12532d161315c2bfc21abd2a (patch)
tree4fd4454e16d6ddfc51e6eecad5b5c96a23291853 /src/plugins
parente87bb9314796804f5e8a45ce5ee8a4c45eb016ff (diff)
downloadrspamd-ae5d1eff5de3951a12532d161315c2bfc21abd2a.tar.gz
rspamd-ae5d1eff5de3951a12532d161315c2bfc21abd2a.zip
[Minor] Fann_redis: Fix iterators & some warnings
- Also number of layers
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/fann_redis.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/fann_redis.lua b/src/plugins/lua/fann_redis.lua
index 0c0559116..42c691d37 100644
--- a/src/plugins/lua/fann_redis.lua
+++ b/src/plugins/lua/fann_redis.lua
@@ -361,7 +361,7 @@ end
local function create_fann(n, nlayers)
local layers = {}
local div = 1.0
- for i in 1,nlayers - 1 do
+ for _ = 1, nlayers do
table.insert(layers, math.floor(n / div))
div = div * 2
end
@@ -907,7 +907,7 @@ else
callback = fann_scores_filter
})
- for k,r in rules do
+ for k,r in pairs(rules) do
rules[k] = default_options
rules[k]['redis'] = redis_params
local cur = rules[k]
@@ -948,7 +948,7 @@ else
settings.rules = rules
-- Add training scripts
- for k,rule in pairs(settings.rules) do
+ for _,rule in pairs(settings.rules) do
rspamd_config:add_on_load(function(cfg, ev_base, worker)
load_scripts(cfg, ev_base, function(_, _)
check_fanns(rule, cfg, ev_base)