wait for hello before cancelling context
This commit is contained in:
parent
ec2480f48c
commit
8f285a599f
@ -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...")
|
||||||
|
Loading…
Reference in New Issue
Block a user