summaryrefslogtreecommitdiffstats
path: root/lualib/lua_redis.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-27 11:02:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-27 11:02:53 +0100
commit0b628d01954cbce49095adf288efe7c7628aba90 (patch)
treeb381784bd5b590ef90404eda3aa3568cee658581 /lualib/lua_redis.lua
parent22dc9f7df797b3f3234c102397b0de4ea66f345b (diff)
downloadrspamd-0b628d01954cbce49095adf288efe7c7628aba90.tar.gz
rspamd-0b628d01954cbce49095adf288efe7c7628aba90.zip
[Minor] Lua_redis: Allow requests with no callback
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r--lualib/lua_redis.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index 67bf271ab..f3ff6d400 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -865,7 +865,9 @@ local function rspamd_redis_make_request(task, redis_params, key, is_write,
else
addr:ok()
end
- callback(err, data, addr)
+ if callback then
+ callback(err, data, addr)
+ end
end
if not task or not redis_params or not callback or not command then
return false,nil,nil
@@ -965,7 +967,9 @@ local function redis_make_request_taskless(ev_base, cfg, redis_params, key,
else
addr:ok()
end
- callback(err, data, addr)
+ if callback then
+ callback(err, data, addr)
+ end
end
local rspamd_redis = require "rspamd_redis"