]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix Redis timeout setup
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 12 Nov 2017 12:52:02 +0000 (12:52 +0000)
committerAndrew Lewis <nerf@judo.za.org>
Wed, 24 Jan 2018 09:53:55 +0000 (11:53 +0200)
MFH: rspamd-1.6

lualib/lua_redis.lua

index 0dc5872fe4b90897e7f4107fb170cf0ef0cd43b2..d41ac0c9885d977cdc1adb9f148b26b3671220f9 100644 (file)
@@ -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