From bb7845dfe39e385d9e02966d54efb211addb79e0 Mon Sep 17 00:00:00 2001 From: Hristo Temelski Date: Thu, 8 May 2025 10:29:05 +0300 Subject: [PATCH] Disable readOnly for cluster s/pubsub client (#2950) --- packages/client/lib/cluster/cluster-slots.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/lib/cluster/cluster-slots.ts b/packages/client/lib/cluster/cluster-slots.ts index c2fde197f4..0679b20034 100644 --- a/packages/client/lib/cluster/cluster-slots.ts +++ b/packages/client/lib/cluster/cluster-slots.ts @@ -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) { - const client = this.#createClient(master, true) + const client = this.#createClient(master, false) .on('server-sunsubscribe', async (channel, listeners) => { try { await this.rediscover(client);