aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-26 16:29:25 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-26 16:29:25 +0000
commitb2c5b2b30cbee6bcbab569b44e8891c5a29eb8ca (patch)
treea809c2920caf3b0f5c86271d9aa97c967652eb96
parentef125b8b1c6f2b84567acd284d1050ee7ace6845 (diff)
downloadrspamd-b2c5b2b30cbee6bcbab569b44e8891c5a29eb8ca.tar.gz
rspamd-b2c5b2b30cbee6bcbab569b44e8891c5a29eb8ca.zip
[Fix] FIx dynamic conf plugin
-rw-r--r--src/plugins/lua/dynamic_conf.lua26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/plugins/lua/dynamic_conf.lua b/src/plugins/lua/dynamic_conf.lua
index 744b8b6f8..29f63e90c 100644
--- a/src/plugins/lua/dynamic_conf.lua
+++ b/src/plugins/lua/dynamic_conf.lua
@@ -140,11 +140,12 @@ local function update_dynamic_conf(cfg, ev_base, recv)
rspamd_logger.errx(cfg, "cannot save dynamic conf to redis: %s", err)
else
rspamd_redis.redis_make_request_taskless(ev_base,
- cfg,
- settings.redis_key,
- true,
- redis_version_set_cb,
- 'HINCRBY', {settings.redis_key, 'v', '1'})
+ cfg,
+ redis_params,
+ settings.redis_key,
+ true,
+ redis_version_set_cb,
+ 'HINCRBY', {settings.redis_key, 'v', '1'})
end
end
@@ -180,8 +181,9 @@ local function update_dynamic_conf(cfg, ev_base, recv)
end
end
local newdata = ucl.to_format(cur_settings.data, 'json-compact')
- rspamd_redis.redis_make_request_taskless(ev_base, cfg, settings.redis_key, true,
- redis_data_set_cb, 'HSET', {settings.redis_key, 'd', newdata})
+ rspamd_redis.redis_make_request_taskless(ev_base, cfg, redis_params,
+ settings.redis_key, true,
+ redis_data_set_cb, 'HSET', {settings.redis_key, 'd', newdata})
end
local function check_dynamic_conf(cfg, ev_base)
@@ -214,8 +216,9 @@ local function check_dynamic_conf(cfg, ev_base)
rspamd_logger.infox(cfg, "need to load fresh dynamic settings with version %s, local version is %s",
rver, cur_settings.version)
cur_settings.version = rver
- rspamd_redis.redis_make_request_taskless(ev_base, cfg, settings.redis_key, false,
- redis_load_cb, 'HGET', {settings.redis_key, 'd'})
+ rspamd_redis.redis_make_request_taskless(ev_base, cfg, redis_params,
+ settings.redis_key, false,
+ redis_load_cb, 'HGET', {settings.redis_key, 'd'})
elseif cur_settings.updates.has_updates then
-- Need to send our updates to Redis
update_dynamic_conf(cfg, ev_base)
@@ -226,8 +229,9 @@ local function check_dynamic_conf(cfg, ev_base)
end
end
- rspamd_redis.redis_make_request_taskless(ev_base, cfg, settings.redis_key, false,
- redis_check_cb, 'HGET', {settings.redis_key, 'v'})
+ rspamd_redis.redis_make_request_taskless(ev_base, cfg, redis_params,
+ settings.redis_key, false,
+ redis_check_cb, 'HGET', {settings.redis_key, 'v'})
end
local section = rspamd_config:get_all_opt("dynamic_conf")