mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 20:38:06 +01:00
Disallow insertion of duplicate messages.
This commit is contained in:
committed by
Jon Chambers
parent
1ccfe928f7
commit
5e3f8b9c2e
@@ -6,6 +6,10 @@ local currentTime = ARGV[2]
|
||||
local sender = ARGV[3]
|
||||
local guid = ARGV[4]
|
||||
|
||||
if redis.call("HEXISTS", queueMetadataKey, guid) == 1 then
|
||||
return tonumber(redis.call("HGET", queueMetadataKey, guid))
|
||||
end
|
||||
|
||||
local messageId = redis.call("HINCRBY", queueMetadataKey, "counter", 1)
|
||||
|
||||
redis.call("ZADD", queueKey, "NX", messageId, message)
|
||||
|
||||
Reference in New Issue
Block a user