summaryrefslogtreecommitdiffstats
path: root/lualib/lua_redis.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r--lualib/lua_redis.lua7
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