From b2c5b2b30cbee6bcbab569b44e8891c5a29eb8ca Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 26 Feb 2018 16:29:25 +0000 Subject: [PATCH] [Fix] FIx dynamic conf plugin --- src/plugins/lua/dynamic_conf.lua | 26 +++++++++++++++----------- 1 file 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") -- 2.39.5