wait for hello before cancelling context

This commit is contained in:
Branden J Brown 2024-02-02 21:33:50 -06:00
parent ec2480f48c
commit 8f285a599f
1 changed files with 1 additions and 1 deletions

View File

@ -206,8 +206,8 @@ func (s *Server) joinAndServe(p person) {
} }
}() }()
id, chall, deal := s.l.Queue(ctx, p.id) id, chall, deal := s.l.Queue(ctx, p.id)
stop()
<-ch <-ch
stop()
if id == (lobby.GameID{}) { if id == (lobby.GameID{}) {
// Context canceled. // Context canceled.
p.conn.Close(websocket.StatusTryAgainLater, "sorry, queue is empty...") p.conn.Close(websocket.StatusTryAgainLater, "sorry, queue is empty...")