summaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-12-10 19:37:02 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-12-10 19:37:02 +0000
commit4dfcb9de863b6714694768a4269dcbe555d811ef (patch)
tree79dfbf298d05837aa3dec4e7f2263716093652e3 /lualib
parent9a58947d9fc01b024cde0a8bd98476c08f17173b (diff)
downloadrspamd-4dfcb9de863b6714694768a4269dcbe555d811ef.tar.gz
rspamd-4dfcb9de863b6714694768a4269dcbe555d811ef.zip
[Minor] Fix `is_write` usage for freshly loaded scripts
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_redis.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index d8f87c7bd..acbb46969 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -1145,12 +1145,13 @@ local function prepare_redis_call(script)
return options
end
-local function load_script_task(script, task)
+local function load_script_task(script, task, is_write)
local rspamd_redis = require "rspamd_redis"
local opts = prepare_redis_call(script)
for _,opt in ipairs(opts) do
opt.task = task
+ opt.is_write = is_write
opt.callback = function(err, data)
if err then
logger.errx(task, 'cannot upload script to %s: %s; registered from: %s:%s',
@@ -1188,13 +1189,14 @@ local function load_script_task(script, task)
end
end
-local function load_script_taskless(script, cfg, ev_base)
+local function load_script_taskless(script, cfg, ev_base, is_write)
local rspamd_redis = require "rspamd_redis"
local opts = prepare_redis_call(script)
for _,opt in ipairs(opts) do
opt.config = cfg
opt.ev_base = ev_base
+ opt.is_write = is_write
opt.callback = function(err, data)
if err then
logger.errx(cfg, 'cannot upload script to %s: %s; registered from: %s:%s',
@@ -1358,7 +1360,7 @@ local function exec_redis_script(id, params, callback, keys, args)
callback('NOSCRIPT', nil)
end
end)
- load_script_task(script, params.task)
+ load_script_task(script, params.task, params.is_write)
end
end