commit 0b628d0: [Minor] Lua_redis: Allow requests with no callback

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Jul 27 10:07:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-27 11:02:53 +0100
URL: https://github.com/rspamd/rspamd/commit/0b628d01954cbce49095adf288efe7c7628aba90 (HEAD -> master)

[Minor] Lua_redis: Allow requests with no callback

---
 lualib/lua_redis.lua | 8 ++++++--
 1 file 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"


More information about the Commits mailing list