diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-04-17 19:34:37 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-04-17 19:34:37 +0300 |
commit | a9ff59c94b8e77c6d3ccf45749c5878d9ddd5c79 (patch) | |
tree | dc991b19ec9245f93b29847cc12152b9c7791f9f /lualib/lua_redis.lua | |
parent | d4216edbf2af2d8347e5669dc73dd019a6ca95d0 (diff) | |
download | rspamd-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.lua | 9 |
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 |