diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-21 15:45:12 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-21 15:45:12 +0000 |
commit | 395c1e6847a3a7162c7415175700076355f8ecd0 (patch) | |
tree | 4e8490273b9b3c841d401353575ffb0a876a27eb | |
parent | 3ef18da334f2022040a6529c1cbc2f311567480f (diff) | |
download | rspamd-395c1e6847a3a7162c7415175700076355f8ecd0.tar.gz rspamd-395c1e6847a3a7162c7415175700076355f8ecd0.zip |
[Fix] Fix various issues in stat_convert
-rw-r--r-- | lualib/lua_redis.lua | 2 | ||||
-rw-r--r-- | lualib/rspamadm/stat_convert.lua | 2 | ||||
-rw-r--r-- | lualib/stat_tools.lua | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index c01cdfae9..2102db841 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -914,6 +914,8 @@ local function redis_connect_sync(redis_params, is_write, key, cfg) if not ret then logger.errx('cannot execute redis request: %s', conn) addr:fail() + + return false,nil,addr end if conn then diff --git a/lualib/rspamadm/stat_convert.lua b/lualib/rspamadm/stat_convert.lua index 31c37880a..f70581fa4 100644 --- a/lualib/rspamadm/stat_convert.lua +++ b/lualib/rspamadm/stat_convert.lua @@ -1,4 +1,4 @@ -local lua_redis = require "rspamd_redis" +local lua_redis = require "lua_redis" local stat_tools = require "stat_tools" local ucl = require "ucl" local logger = require "rspamd_logger" diff --git a/lualib/stat_tools.lua b/lualib/stat_tools.lua index f969f1000..f952ec9a9 100644 --- a/lualib/stat_tools.lua +++ b/lualib/stat_tools.lua @@ -223,7 +223,7 @@ end if is_spam then hash_key = 'S' end - for _,tok in tokens do + for _,tok in ipairs(tokens) do -- tok schema: -- tok[1] = token_id (uint64 represented as a string) -- tok[2] = token value (number) @@ -356,8 +356,9 @@ end end end - logger.messagex('Migrated %d tokens for %d users for symbol %s', - total, nusers, res['symbol']) + logger.messagex('Migrated %s tokens for %s users for symbols (%s, %s)', + total, nusers, symbol_spam, symbol_ham) + return true end exports.convert_sqlite_to_redis = convert_sqlite_to_redis |