diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-01 14:22:17 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-01 14:22:17 +0100 |
commit | 7dfecb9cc8f3ceffaf3a3077166807bfb8fff231 (patch) | |
tree | adb6773e1f66e9dfc02a64d79d1e1fe5a66b7956 /src/plugins/lua | |
parent | 302da75c22217d0c8c0a6a868b85e81df8f63dd0 (diff) | |
download | rspamd-7dfecb9cc8f3ceffaf3a3077166807bfb8fff231.tar.gz rspamd-7dfecb9cc8f3ceffaf3a3077166807bfb8fff231.zip |
[Fix] Another fix for Redis sentinel
Issue: #2796
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/bayes_expiry.lua | 11 | ||||
-rw-r--r-- | src/plugins/lua/reputation.lua | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/lua/bayes_expiry.lua b/src/plugins/lua/bayes_expiry.lua index 9f5d7a68f..6e2c328dc 100644 --- a/src/plugins/lua/bayes_expiry.lua +++ b/src/plugins/lua/bayes_expiry.lua @@ -97,10 +97,13 @@ local function check_redis_classifier(cls, cfg) end -- Now try to load redis_params if needed - local redis_params = {} - if not lredis.try_load_redis_servers(cls, rspamd_config, redis_params) then - if not lredis.try_load_redis_servers(cfg[N] or E, rspamd_config, redis_params) then - if not lredis.try_load_redis_servers(cfg['redis'] or E, rspamd_config, redis_params) then + local redis_params + redis_params = lredis.try_load_redis_servers(cls, rspamd_config, false, 'bayes') + if not redis_params then + redis_params = lredis.try_load_redis_servers(cfg[N] or E, rspamd_config, false, 'bayes') + if not redis_params then + redis_params = lredis.try_load_redis_servers(cfg[N] or E, rspamd_config, true) + if not redis_params then return false end end diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua index e91c6ebb7..b72c00719 100644 --- a/src/plugins/lua/reputation.lua +++ b/src/plugins/lua/reputation.lua @@ -897,8 +897,9 @@ end local function reputation_redis_init(rule, cfg, ev_base, worker) local our_redis_params = {} - if not lua_redis.try_load_redis_servers(rule.backend.config, - rspamd_config, our_redis_params) then + our_redis_params = lua_redis.try_load_redis_servers(rule.backend.config, rspamd_config, + true) + if not our_redis_params then our_redis_params = redis_params end if not our_redis_params then |