Skip to content

new ioredis.Cluster in getNumSub function constructor.name is not "Cluster" #450

Closed
@ReflexFox

Description

@ReflexFox

"ioredis": "^5.0.4",

const { createAdapter } = require("./redis-adapter");
const redisUrlArr = [url1,url2,...]
const Redis = require("ioredis");
const pubClient = new Redis.Cluster(redisUrlArr);
const subClient = pubClient.duplicate();
const io = require("socket.io")(server, {
transports: ["websocket"],
adapter: createAdapter(pubClient, subClient),
cors: {
origin: "*",
methods: ["GET", "POST"],
},
});

I am using ioredis to create a cluster mode redis but i fonud redis-adapter getNumSub function
image
this.pubClient.constructor.name not "Cluster"
so in redis Cluster mode fetchSockets function only can get current server users

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions