]> 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>
Sat, 20 May 2017 11:20:38 +0000 (12:20 +0100)
Issue: #1646

rules/global_functions.lua

index e3c95c549a1063a098448d1ce28c9874118e92f7..9c1decfaf98422f4d160470746fbbd1102f21fb8 100644 (file)
@@ -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