aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/rspamadm/stat_convert.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-23 14:13:58 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-23 14:13:58 +0000
commit4fda9686da8300e8f187ae784819f8eb040846e5 (patch)
treeb8539fc73d2fe96523b865d7b0320d17486dddaa /lualib/rspamadm/stat_convert.lua
parent13885fec3a2a84a49687f2d50ce7cbe8723b2af2 (diff)
downloadrspamd-4fda9686da8300e8f187ae784819f8eb040846e5.tar.gz
rspamd-4fda9686da8300e8f187ae784819f8eb040846e5.zip
[Minor] Move parse_time_interval to lua_util
Diffstat (limited to 'lualib/rspamadm/stat_convert.lua')
-rw-r--r--lualib/rspamadm/stat_convert.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lualib/rspamadm/stat_convert.lua b/lualib/rspamadm/stat_convert.lua
index 6ad3b0332..230dc3f3f 100644
--- a/lualib/rspamadm/stat_convert.lua
+++ b/lualib/rspamadm/stat_convert.lua
@@ -2,10 +2,13 @@ local lua_redis = require "lua_redis"
local stat_tools = require "lua_stat"
local ucl = require "ucl"
local logger = require "rspamd_logger"
-
+local lua_util = require "lua_util"
return function (_, res)
local redis_params = {}
+ if res.expire then
+ res.expire = lua_util.parse_time_interval(res.expire)
+ end
if not lua_redis.try_load_redis_servers(res.redis, nil, redis_params) then
logger.errx('cannot load redis server definition')
@@ -29,7 +32,7 @@ return function (_, res)
end
logger.messagex('Converted classifier to the from sqlite to redis')
logger.messagex('Suggested configuration:')
- logger.messagex(ucl.to_format(stat_tools.redis_classifier_from_sqlite(cls),
+ logger.messagex(ucl.to_format(stat_tools.redis_classifier_from_sqlite(cls, res.expire),
'config'))
end
end