You've already forked node-redis
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:
@@ -518,7 +518,7 @@ export default class RedisClusterSlots<
|
|||||||
node = index < this.masters.length ?
|
node = index < this.masters.length ?
|
||||||
this.masters[index] :
|
this.masters[index] :
|
||||||
this.replicas[index - this.masters.length],
|
this.replicas[index - this.masters.length],
|
||||||
client = this.#createClient(node, index >= this.masters.length);
|
client = this.#createClient(node, false);
|
||||||
|
|
||||||
this.pubSubNode = {
|
this.pubSubNode = {
|
||||||
address: node.address,
|
address: node.address,
|
||||||
@@ -563,7 +563,7 @@ export default class RedisClusterSlots<
|
|||||||
}
|
}
|
||||||
|
|
||||||
async #initiateShardedPubSubClient(master: MasterNode<M, F, S, RESP, TYPE_MAPPING>) {
|
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) => {
|
.on('server-sunsubscribe', async (channel, listeners) => {
|
||||||
try {
|
try {
|
||||||
await this.rediscover(client);
|
await this.rediscover(client);
|
||||||
|
Reference in New Issue
Block a user