From: Vsevolod Stakhov Date: Sat, 27 Jul 2019 10:02:53 +0000 (+0100) Subject: [Minor] Lua_redis: Allow requests with no callback X-Git-Tag: 2.0~478 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b628d01954cbce49095adf288efe7c7628aba90;p=thirdparty%2Frspamd.git [Minor] Lua_redis: Allow requests with no callback --- diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index 67bf271ab1..f3ff6d4009 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"