diff --git a/frontend/frontend.go b/frontend/frontend.go index 2870e4ed..e600aa1b 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -119,14 +119,19 @@ func streamAssignments(ctx context.Context, assignments chan *pb.Assignment, err errs <- fmt.Errorf("error getting assignment stream: %w", err) return } - for { + + var assignment *pb.Assignment + for assignment.GetConnection() == "" { resp, err := stream.Recv() if err != nil { errs <- fmt.Errorf("error streaming assignment: %w", err) return } - assignments <- resp.Assignment + assignment = resp.Assignment } + + assignments <- assignment + log.Printf("Got assignment: %v", assignment) } func connectFrontendServer() (*grpc.ClientConn, error) { diff --git a/game/pb/messages.pb.go b/game/pb/messages.pb.go index 4a24cfd9..888e5c42 100644 --- a/game/pb/messages.pb.go +++ b/game/pb/messages.pb.go @@ -21,10 +21,11 @@ package pb import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const (