From 2476107d16aa25d93ed5c44a96d54dcfd020ee3d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 9 Jun 2017 11:30:54 +0100 Subject: [PATCH] [Minor] Improve redis params parsing --- lualib/lua_redis.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index 1b73f0e8f..42a0aacef 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -37,7 +37,7 @@ local function rspamd_parse_redis_server(module_name) end -- Store options - if not result['timeout'] then + if not result['timeout'] and not result['timeout'] == default_timeout then if options['timeout'] then result['timeout'] = tonumber(options['timeout']) else @@ -48,11 +48,12 @@ local function rspamd_parse_redis_server(module_name) if options['prefix'] and not result['prefix'] then result['prefix'] = options['prefix'] end + if not result['db'] then if options['db'] then - result['db'] = options['db'] + result['db'] = tostring(options['db']) elseif options['dbname'] then - result['db'] = options['dbname'] + result['db'] = tostring(options['dbname']) end end if options['password'] and not result['password'] then -- 2.39.5