From f7054dc0b595e3ed714a5d859c049672aa2eba08 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 19 May 2017 16:12:57 +0100 Subject: [PATCH] [Fix] Fix Redis timeout set Issue: #1646 --- lualib/global_functions.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lualib/global_functions.lua b/lualib/global_functions.lua index 17c8f11ea..4447f85ef 100644 --- a/lualib/global_functions.lua +++ b/lualib/global_functions.lua @@ -38,11 +38,13 @@ local function rspamd_parse_redis_server(module_name) -- Store options if not result['timeout'] then - result['timeout'] = default_timeout - end - if options['timeout'] and not result['timeout'] then - result['timeout'] = tonumber(options['timeout']) + if options['timeout'] then + result['timeout'] = tonumber(options['timeout']) + else + result['timeout'] = default_timeout + end end + if options['prefix'] and not result['prefix'] then result['prefix'] = options['prefix'] end -- 2.39.5