Skip to content

fetchSockets not working over redis adapter #3977

Answered by darrachequesne
djllap asked this question in Q&A
Discussion options

You must be logged in to vote

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:

setInterval(async () => {
  const sockets = await io.fetchSockets();
  console.log("fetchSockets", sockets.length);
}, 5000);

Could you please check?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@djllap
Comment options

@darrachequesne
Comment options

@djllap
Comment options

Answer selected by djllap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants