mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-19 22:08:06 +01:00
Only unsubscribe from keyspace notifications if the node has the slot
This commit is contained in:
@@ -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