diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-31 18:33:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-31 18:33:04 +0100 |
commit | 32537ef12ff8a0bc5781769cd1cd75823438866f (patch) | |
tree | 3a21955990bf88bf2019aa29cdc79608103b94b2 /src/plugins/lua/fann_redis.lua | |
parent | 22cdfbaa949c925691e11a0d6ffa72e640c652f9 (diff) | |
parent | ae5d1eff5de3951a12532d161315c2bfc21abd2a (diff) | |
download | rspamd-32537ef12ff8a0bc5781769cd1cd75823438866f.tar.gz rspamd-32537ef12ff8a0bc5781769cd1cd75823438866f.zip |
Merge pull request #1781 from fatalbanana/fann
[Minor] Fann_redis: Fix iterator & some warnings
Diffstat (limited to 'src/plugins/lua/fann_redis.lua')
-rw-r--r-- | src/plugins/lua/fann_redis.lua | 6 |
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) |