From 5648d0506d42a114ba29b18a89e41f86ad56de36 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 --- rules/global_functions.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rules/global_functions.lua b/rules/global_functions.lua index e3c95c549..9c1decfaf 100644 --- a/rules/global_functions.lua +++ b/rules/global_functions.lua @@ -36,11 +36,13 @@ 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