Drop the "repair message queue metadata" script.

This commit is contained in:
Jon Chambers 2020-10-08 16:14:46 -04:00 committed by Jon Chambers
parent ac2ff29288
commit 775d56fe52
1 changed files with 0 additions and 18 deletions

View File

@ -1,18 +0,0 @@
local queueKey = KEYS[1]
local queueMetadataKey = KEYS[2]
local firstMessageId = tonumber(redis.call("ZRANGE", queueKey, 0, 0, "WITHSCORES")[2])
local lastMessageId = tonumber(redis.call("ZRANGE", queueKey, -1, -1, "WITHSCORES")[2])
if firstMessageId and lastMessageId then
for messageId = firstMessageId,lastMessageId do
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)
else
-- No message actually exists with that ID; drop the metadata reference to that ID
redis.call("HDEL", queueMetadataKey, messageId .. "guid")
end
end
end