Add check for existing key to MessagesCacheInsertSharedMultiRecipientPayloadAndViewsScript

This commit is contained in:
Chris Eager
2024-09-06 16:11:43 -05:00
committed by Chris Eager
parent 020c21f4ef
commit 5bc6ff0e77
6 changed files with 45 additions and 20 deletions

View File

@@ -4,6 +4,10 @@ local sharedMrmKey = KEYS[1] -- [string] the key containing the shared MRM data
local mrmData = ARGV[1] -- [bytes] the serialized multi-recipient message data
-- the remainder of ARGV is list of recipient keys and view data
if 1 == redis.call("EXISTS", sharedMrmKey) then
return redis.error_reply("ERR key exists")
end
redis.call("HSET", sharedMrmKey, "data", mrmData);
redis.call("EXPIRE", sharedMrmKey, 604800) -- 7 days