diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-16 11:26:19 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-16 11:26:19 +0000 |
commit | fc94de016a63d637748c6b5c1b42777978a92597 (patch) | |
tree | 492a002c3b39d77d8fe98cdf67ad1613d22bc526 | |
parent | 5bec51d7ef9a774b8aecec8f1e48a1b01babfbd3 (diff) | |
download | rspamd-fc94de016a63d637748c6b5c1b42777978a92597.tar.gz rspamd-fc94de016a63d637748c6b5c1b42777978a92597.zip |
[Fix] More fixes in ANN loading
-rw-r--r-- | src/plugins/lua/fann_redis.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/lua/fann_redis.lua b/src/plugins/lua/fann_redis.lua index 324b7ba29..8b5684c9b 100644 --- a/src/plugins/lua/fann_redis.lua +++ b/src/plugins/lua/fann_redis.lua @@ -629,16 +629,15 @@ local function check_fanns(_, ev_base) local redis_update_cb = function(_err, _data) if _err then rspamd_logger.errx(rspamd_config, 'cannot get FANN version %s from redis: %s', elt, _err) - elseif _data and type(_data) == 'string' then + elseif _data and type(_data) == 'table' then load_or_invalidate_fann(_data, elt, ev_base) end end local local_ver = 0 - local numelt = tonumber(elt) - if fanns[numelt] then - if fanns[numelt].version then - local_ver = fanns[numelt].version + if fanns[elt] then + if fanns[elt].version then + local_ver = fanns[elt].version end end redis_make_request(ev_base, |