]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix Redis timeout set
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 19 May 2017 15:12:57 +0000 (16:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 19 May 2017 15:12:57 +0000 (16:12 +0100)
Issue: #1646

lualib/global_functions.lua

index 17c8f11ea2ab3a05b3ae62858391e4bd3f0915f1..4447f85ef144a4542709c28d03e5d2c583d86ff6 100644 (file)
@@ -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