I am facing an error when fetching sockets with the .fetchSockets function. I'm using cluster-adapter + sticky + pm2 to manage workers.
Code snippet that calls the fetchSockets() function:
const sockets= await io
.in(`${plataform}-${client}`)
.fetchSockets();
//In other line
const sockets = (
await io
.in(`${plataform}-${client}-${userId}`)
.fetchSockets()
)[0];
```
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: timeout reached: only 4 responses received out of 5
at Timeout._onTimeout (/opt/server/node_modules/@socket.io/cluster-adapter/dist/index.js:358:28)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
I've already tried everything. Furthermore, I already put a try catch around this promise