Check that the return of ZRANGEBYSCORE isn't an empty list.

This commit is contained in:
Jon Chambers 2020-10-05 10:29:00 -04:00 committed by Jon Chambers
parent 7dd40fd2d4
commit c885540749
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ local lastMessageId = tonumber(redis.call("ZRANGE", queueKey, -1, -1, "WITHSCOR
if firstMessageId and lastMessageId then
for messageId = firstMessageId,lastMessageId do
if redis.call("ZRANGEBYSCORE", queueKey, messageId, messageId) then
if next(redis.call("ZRANGEBYSCORE", queueKey, messageId, messageId)) then
-- This message actually exists, and its GUID may be pointing to the wrong ID
local guid = redis.call("HGET", queueMetadataKey, messageId .. "guid")
redis.call("HSET", queueMetadataKey, guid, messageId)