diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-02-21 17:32:10 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-02-22 14:08:24 +0000 |
commit | 08595091977274a52c8872aacce15049b14f8c33 (patch) | |
tree | 15d04bb91dc25288485da4f3d9ece3998f0eefec /src/plugins/lua/history_redis.lua | |
parent | dba9407cbc06ff4d8f9b1d4cfcdee5febc58df76 (diff) | |
download | rspamd-08595091977274a52c8872aacce15049b14f8c33.tar.gz rspamd-08595091977274a52c8872aacce15049b14f8c33.zip |
[Fix] Allow different template expansion parameters
Probably one of the most dirty hacks I've used in the Lua code in Rspamd...
Diffstat (limited to 'src/plugins/lua/history_redis.lua')
-rw-r--r-- | src/plugins/lua/history_redis.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua index f2554ef93..3365b30cd 100644 --- a/src/plugins/lua/history_redis.lua +++ b/src/plugins/lua/history_redis.lua @@ -149,7 +149,7 @@ local function history_save(task) end local data = task:get_protocol_reply { 'metrics', 'basic' } - local prefix = lua_util.jinja_template(settings.key_prefix, template_env) + local prefix = lua_util.jinja_template(settings.key_prefix, template_env, false, true) if data then normalise_results(data, task) @@ -183,7 +183,7 @@ local function history_save(task) end local function handle_history_request(task, conn, from, to, reset) - local prefix = lua_util.jinja_template(settings.key_prefix, template_env) + local prefix = lua_util.jinja_template(settings.key_prefix, template_env, false, true) if reset then local function redis_ltrim_cb(err, _) @@ -305,7 +305,7 @@ if opts then flags = 'empty,explicit_disable,ignore_passthrough', augmentations = { string.format("timeout=%f", redis_params.timeout or 0.0) } }) - lua_redis.register_prefix(lua_util.jinja_template(settings.key_prefix, template_env), N, + lua_redis.register_prefix(lua_util.jinja_template(settings.key_prefix, template_env, false, true), N, "Redis history", { type = 'list', }) |