From: Vsevolod Stakhov Date: Fri, 9 Jun 2017 10:30:54 +0000 (+0100) Subject: [Minor] Improve redis params parsing X-Git-Tag: 1.6.0~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2476107d16aa25d93ed5c44a96d54dcfd020ee3d;p=rspamd.git [Minor] Improve redis params parsing --- 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