Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ReflexFox opened this issue Apr 26, 2022 · 1 comment
Milestone

Comments

@ReflexFox
Copy link
Contributor

ReflexFox commented Apr 26, 2022

"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

@darrachequesne
Copy link
Member

This should be fixed by d2faa8a, included in version 7.2.0.

@darrachequesne darrachequesne added this to the 7.2.0 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants