summaryrefslogtreecommitdiffstats
path: root/lualib/lua_redis.lua
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-04-17 19:34:37 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-04-17 19:34:37 +0300
commita9ff59c94b8e77c6d3ccf45749c5878d9ddd5c79 (patch)
treedc991b19ec9245f93b29847cc12152b9c7791f9f /lualib/lua_redis.lua
parentd4216edbf2af2d8347e5669dc73dd019a6ca95d0 (diff)
downloadrspamd-a9ff59c94b8e77c6d3ccf45749c5878d9ddd5c79.tar.gz
rspamd-a9ff59c94b8e77c6d3ccf45749c5878d9ddd5c79.zip
[Minor] Stop expiry if read_servers configured
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r--lualib/lua_redis.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index 067353abc..1be476fbe 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -69,7 +69,7 @@ local function try_load_redis_servers(options, rspamd_config, result)
upstreams_write = upstream_list.create(options['write_servers'],
default_port)
end
- else
+ elseif not options['read_servers'] then
upstreams_write = upstreams_read
end
end
@@ -106,10 +106,11 @@ local function try_load_redis_servers(options, rspamd_config, result)
result['password'] = options['password']
end
- if upstreams_write and upstreams_read then
+ if upstreams_read then
result.read_servers = upstreams_read
- result.write_servers = upstreams_write
-
+ if upstreams_write then
+ result.write_servers = upstreams_write
+ end
return true
end