diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-09 11:30:54 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-09 11:30:54 +0100 |
commit | 2476107d16aa25d93ed5c44a96d54dcfd020ee3d (patch) | |
tree | ff24c3005d15329580662533138215d4d519beb5 /lualib/lua_redis.lua | |
parent | f6390feadeb181f896b0bb5375109dc3c08b69e6 (diff) | |
download | rspamd-2476107d16aa25d93ed5c44a96d54dcfd020ee3d.tar.gz rspamd-2476107d16aa25d93ed5c44a96d54dcfd020ee3d.zip |
[Minor] Improve redis params parsing
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r-- | lualib/lua_redis.lua | 7 |
1 files 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 |