1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Disable readOnly for cluster s/pubsub client (#2950)

This commit is contained in:
Hristo Temelski
2025-05-08 10:29:05 +03:00
committed by GitHub
parent 86480aaa74
commit bb7845dfe3

View File

@@ -518,7 +518,7 @@ export default class RedisClusterSlots<
node = index < this.masters.length ?
this.masters[index] :
this.replicas[index - this.masters.length],
client = this.#createClient(node, index >= this.masters.length);
client = this.#createClient(node, false);
this.pubSubNode = {
address: node.address,
@@ -563,7 +563,7 @@ export default class RedisClusterSlots<
}
async #initiateShardedPubSubClient(master: MasterNode<M, F, S, RESP, TYPE_MAPPING>) {
const client = this.#createClient(master, true)
const client = this.#createClient(master, false)
.on('server-sunsubscribe', async (channel, listeners) => {
try {
await this.rediscover(client);