From bdc46692b31d7388cf4d2135b8a73526708a4c87 Mon Sep 17 00:00:00 2001 From: Yaya Liu Date: Wed, 2 Nov 2022 00:46:15 +0800 Subject: [PATCH] fix redis nil in lua Redis Nil bulk reply and Nil multi bulk reply -> Lua false boolean type --- delayqueue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delayqueue.go b/delayqueue.go index 9d1c316..65d299b 100644 --- a/delayqueue.go +++ b/delayqueue.go @@ -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