]> source.dussan.org Git - rspamd.git/commitdiff
Fix redis read_only was incorrectly set to true. 2325/head
authorBoris Gulay <boris@gulay.name>
Wed, 4 Jul 2018 09:04:34 +0000 (12:04 +0300)
committerBoris Gulay <boris@gulay.name>
Wed, 4 Jul 2018 09:04:34 +0000 (12:04 +0300)
We should use local variables in this check because result['xxx'] are assigned later.

lualib/lua_redis.lua

index d22a4010c988ece5347b9cfc179d6d1c2e74ee5c..33757b1548acfef9d049304e051d50d54d0a4cf1 100644 (file)
@@ -110,9 +110,9 @@ local function try_load_redis_servers(options, rspamd_config, result)
     result['password'] = options['password']
   end
 
-  if read_only and not result.write_servers then
+  if read_only and not upstreams_write then
     result.read_only = true
-  elseif result.write_servers then
+  elseif upstreams_write then
     result.read_only = false
   end