From: Alexander Moisseev Date: Tue, 17 Apr 2018 16:34:37 +0000 (+0300) Subject: [Minor] Stop expiry if read_servers configured X-Git-Tag: 1.7.4~75^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F2182%2Fhead;p=rspamd.git [Minor] Stop expiry if read_servers configured --- 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,