aws-samples / aws-samples/amazon-nova-samples
(S2S sample-codes/websocket-nodejs) Active connections always 0
Open
- Dominant language
- Jupyter Notebook
- Stars
- 452
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
`server.ts` shows always 0 as active connections.
This is due to using the wrong way of calculating connections count
https://github.com/aws-samples/amazon-nova-samples/blob/6f5ab3f04ea3b77ad7c5a228cc5a1dafe662be86/speech-to-speech/sample-codes/websocket-nodejs/src/server.ts#L65-L68
It should be:
`io.sockets.sockets.size`
The `setInterval` should be moved outside of the callback, otherwise every new connection will create a new one.
Contributor guide
Assessment
This issue has not been assessed yet.