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 | |
parent | d4216edbf2af2d8347e5669dc73dd019a6ca95d0 (diff) | |
download | rspamd-a9ff59c94b8e77c6d3ccf45749c5878d9ddd5c79.tar.gz rspamd-a9ff59c94b8e77c6d3ccf45749c5878d9ddd5c79.zip |
[Minor] Stop expiry if read_servers configured
-rw-r--r-- | lualib/lua_redis.lua | 9 | ||||
-rw-r--r-- | src/plugins/lua/bayes_expiry.lua | 1 |
2 files changed, 6 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 diff --git a/src/plugins/lua/bayes_expiry.lua b/src/plugins/lua/bayes_expiry.lua index 77ec2e527..488219367 100644 --- a/src/plugins/lua/bayes_expiry.lua +++ b/src/plugins/lua/bayes_expiry.lua @@ -81,6 +81,7 @@ local function check_redis_classifier(cls, cfg) end end end + if redis_params['read_servers'] ~= redis_params['write_servers'] then return end table.insert(settings.classifiers, { symbol_spam = symbol_spam, |