Ensure connection is closed after group cancel for safety
This commit is contained in:
parent
c16062ae40
commit
1aa3073540
|
@ -266,6 +266,11 @@ func (r *Room) HandleConn(playerID uuid.UUID, nickname string, c *websocket.Conn
|
|||
r.sendAll()
|
||||
}()
|
||||
|
||||
g.Go(func() error {
|
||||
<-ctx.Done()
|
||||
return c.Close(websocket.StatusGoingAway, "going away")
|
||||
})
|
||||
|
||||
g.Go(func() error {
|
||||
ticker := time.NewTicker(time.Minute)
|
||||
defer ticker.Stop()
|
||||
|
|
Loading…
Reference in New Issue