mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 06:38:04 +01:00
Publish "messages persisted" events when unlocking queues after a persistence run
This commit is contained in:
committed by
Jon Chambers
parent
084607f359
commit
562b495a18
9
service/src/main/resources/lua/unlock_queue.lua
Normal file
9
service/src/main/resources/lua/unlock_queue.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Unlocks a message queue when a persist-to-DynamoDB run has finished and publishes an event notifying listeners that
|
||||
-- messages have been persisted
|
||||
|
||||
local persistInProgressKey = KEYS[1] -- simple string key whose presence indicates a lock
|
||||
local eventChannelKey = KEYS[2] -- the channel on which to publish the "messages persisted" event
|
||||
local eventPayload = ARGV[1] -- [bytes] a protobuf payload for a "message persisted" pub/sub event
|
||||
|
||||
redis.call("DEL", persistInProgressKey)
|
||||
redis.call("SPUBLISH", eventChannelKey, eventPayload)
|
||||
Reference in New Issue
Block a user