fetchSockets not working over redis adapter #3977
-
|
I've recently upgraded to 4.x, replacing socket.io-redis custom hook functions with I'm using socket.io/redis-adapter 7.0.0 and socket.io 4.1.2
Is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Yes, the Redis adapter supports the I am not able to reproduce the issue: https://github.com/socketio/socket.io-fiddle/tree/multiple-servers I tested with 2 servers and 2 clients (1 per server), and the following code seems to work: setInterval(async () => {
const sockets = await io.fetchSockets();
console.log("fetchSockets", sockets.length);
}, 5000);Could you please check? |
Beta Was this translation helpful? Give feedback.
Yes, the Redis adapter supports the
fetchSockets, and should return the socket instances from the other nodes.I am not able to reproduce the issue: https://github.com/socketio/socket.io-fiddle/tree/multiple-servers
I tested with 2 servers and 2 clients (1 per server), and the following code seems to work:
Could you please check?