Skip to content

Commit

Permalink
feat: provide content for connection to keep it alive
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Dec 22, 2024
1 parent c8c3dd1 commit 7a95b53
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/cache/websockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func (c *Cache[T]) ServeWS() http.HandlerFunc {
// spawning goroutine to handle connection
go func() {
defer c.removeConnection(conn)
for {
_, _, err := conn.ReadMessage()
if err != nil {
return
}
}
}()
}
}
Expand Down

0 comments on commit 7a95b53

Please sign in to comment.