fix redis nil in lua

Redis Nil bulk reply and Nil multi bulk reply -> Lua false boolean type
This commit is contained in:
Yaya Liu
2022-11-02 00:46:15 +08:00
committed by finley
parent 89b3abbb8d
commit bdc46692b3

View File

@@ -361,7 +361,7 @@ local unack2retry = function(msgs)
local retryCounts = redis.call('HMGet', KEYS[2], unpack(msgs)) -- get retry count
for i,v in ipairs(retryCounts) do
local k = msgs[i]
if v ~= nil and v ~= '' and tonumber(v) > 0 then
if v ~= false and v ~= nil and v ~= '' and tonumber(v) > 0 then
redis.call("HIncrBy", KEYS[2], k, -1) -- reduce retry count
redis.call("LPush", KEYS[3], k) -- add to retry
else