Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions server/game/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ func (repo *Repository) joinRoom(ctx context.Context, id string, client *pb.Clie
return nil, WithCode(
xerrors.Errorf("context done: room=%v", room.Id),
codes.DeadlineExceeded)
case <-room.Done():
return nil, NormalWithCode(
xerrors.Errorf("room done: room=%v", room.Id),
codes.NotFound)
case room.msgCh <- msg:
}

Expand All @@ -261,6 +265,10 @@ func (repo *Repository) joinRoom(ctx context.Context, id string, client *pb.Clie
return nil, WithCode(
xerrors.Errorf("context done: room=%v", room.Id),
codes.DeadlineExceeded)
case <-room.Done():
return nil, NormalWithCode(
xerrors.Errorf("room done: room=%v", room.Id),
codes.NotFound)
case ewc := <-errch:
return nil, ewc
case joined = <-jch:
Expand Down
Loading