summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/history_redis.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-02-21 17:32:10 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-02-22 14:08:24 +0000
commit08595091977274a52c8872aacce15049b14f8c33 (patch)
tree15d04bb91dc25288485da4f3d9ece3998f0eefec /src/plugins/lua/history_redis.lua
parentdba9407cbc06ff4d8f9b1d4cfcdee5febc58df76 (diff)
downloadrspamd-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.lua6
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',
})