mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 05:36:47 +00:00
Only unsubscribe from keyspace notifications if the node has the slot
This commit is contained in:
1 parent
d290aad27b
commit
bc02fe3831
1 file changed
+6
-3
@@ -330,9 +330,12 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
|
||||
}
|
||||
|
||||
private void unsubscribeFromKeyspaceNotifications(final String queueName) {
|
||||
pubSubConnection.usePubSubConnection(connection -> connection.sync().upstream()
|
||||
.commands()
|
||||
.unsubscribe(getKeyspaceChannels(queueName)));
|
||||
final int slot = SlotHash.getSlot(queueName);
|
||||
|
||||
pubSubConnection.usePubSubConnection(
|
||||
connection -> connection.sync().nodes(node -> node.is(RedisClusterNode.NodeFlag.UPSTREAM) && node.hasSlot(slot))
|
||||
.commands()
|
||||
.unsubscribe(getKeyspaceChannels(queueName)));
|
||||
}
|
||||
|
||||
private static String[] getKeyspaceChannels(final String queueName) {
|
||||
|
||||
Reference in new issue
Block a user