feat: better close message, add channel capacity

This commit is contained in:
2025-08-01 13:04:17 -05:00
parent a71ec6ed25
commit 2bcb4c2594
2 changed files with 24 additions and 17 deletions

View File

@@ -50,7 +50,9 @@ func ListenWebsocket(conn *websocket.Conn, c chan ChanMsg) {
// Message sent successfully
default:
// Channel is full or closed, break out of loop
slog.Warn("Websocket message channel is full or closed, stopping listener")
slog.Warn("Websocket message channel is full or closed, stopping listener",
"channel_capacity", cap(c),
"channel_length", len(c))
close(c)
return
}