From: Vsevolod Stakhov Date: Sun, 12 Nov 2017 12:52:02 +0000 (+0000) Subject: [Fix] Fix Redis timeout setup X-Git-Tag: 1.6.6~3^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dac4f30d5e8ea807ad16e16a6397cfb98215076;p=thirdparty%2Frspamd.git [Fix] Fix Redis timeout setup MFH: rspamd-1.6 --- diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index 0dc5872fe4..d41ac0c988 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -37,7 +37,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 @@ -80,11 +80,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