local logger = require "rspamd_logger"
local sqlite3 = require "rspamd_sqlite3"
-local redis = require "rspamd_redis"
local util = require "rspamd_util"
local lua_redis = require "lua_redis"
local exports = {}
-local N = "stats_tools"
+local N = "stat_tools" -- luacheck: ignore (maybe unused)
-- Performs synchronous conversion of redis schema
local function convert_bayes_schema(redis_params, symbol_spam, symbol_ham, expire)
-- So we can expire individual records, measure most popular elements by zranges,
-- add new fields, such as tokens etc
- local res,conn,_ = lua_redis.redis_connect_sync(redis_params, true)
+ local res,conn = lua_redis.redis_connect_sync(redis_params, true)
if not res then
logger.errx("cannot connect to redis server")
]]
conn:add_cmd('EVAL', {lua_script, '3', symbol_spam, 'S', tostring(expire)})
- local ret, res = conn:exec()
+ local ret
+ ret, res = conn:exec()
if not ret then
logger.errx('error converting symbol %s', symbol_spam)
]]
conn:add_cmd('EVAL', {lua_script, '2', symbol_spam, 'learns_spam'})
- local ret, _ = conn:exec()
+ ret = conn:exec()
if not ret then
logger.errx('error converting metadata for symbol %s', symbol_spam)
end
conn:add_cmd('EVAL', {lua_script, '2', symbol_ham, 'learns_ham'})
- local ret, _ = conn:exec()
+ ret = conn:exec()
if not ret then
logger.errx('error converting metadata for symbol %s', symbol_ham)
return false
end
- local res,conn,_ = lua_redis.redis_connect_sync(redis_params, true)
+ local res,conn = lua_redis.redis_connect_sync(redis_params, true)
if not res then
logger.errx("cannot connect to redis server")