aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_redis.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-12 12:52:02 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-12 12:52:02 +0000
commit66f8da4b5383ef2d23fec376752784b68f4065c5 (patch)
treee1de60ca2c7fa581286c0a15faf5d061e7453339 /lualib/lua_redis.lua
parent48a84895679ea33d71b8b981e90374135a347a36 (diff)
downloadrspamd-66f8da4b5383ef2d23fec376752784b68f4065c5.tar.gz
rspamd-66f8da4b5383ef2d23fec376752784b68f4065c5.zip
[Fix] Fix Redis timeout setup
MFH: rspamd-1.6
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r--lualib/lua_redis.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index 61dc95a1c..7ecb3d424 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -57,7 +57,7 @@ local function rspamd_parse_redis_server(module_name, module_opts, no_fallback)
end
-- Store options
- if not result['timeout'] and not result['timeout'] == default_timeout then
+ if not result['timeout'] or result['timeout'] == default_timeout then
if options['timeout'] then
result['timeout'] = tonumber(options['timeout'])
else
@@ -106,11 +106,19 @@ local function rspamd_parse_redis_server(module_name, module_opts, no_fallback)
local ret = false
if opts then
+ if opts.redis then
+ ret = try_load_redis_servers(opts.redis, result)
+
+ if ret then
+ return result
+ end
+ end
+
ret = try_load_redis_servers(opts, result)
- end
- if ret then
- return result
+ if ret then
+ return result
+ end
end
if no_fallback then return nil end