Skip to content

Commit

Permalink
fix context cancel by grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Sep 24, 2024
1 parent 2eec45d commit 9ff7a99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/server/server_ipc.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func (s *Server) HandlerReady(_ context.Context, req *ipc.HandlerReadyRequest) (
return &emptypb.Empty{}, nil
}

func (s *Server) HandlerUpdate(ctx context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
if err := s.ioClient.UpdateEgress(ctx, info); err != nil {
func (s *Server) HandlerUpdate(_ context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
if err := s.ioClient.UpdateEgress(context.Background(), info); err != nil {
logger.Errorw("failed to update egress", err)
}

Expand All @@ -47,8 +47,8 @@ func (s *Server) HandlerUpdate(ctx context.Context, info *livekit.EgressInfo) (*
return &emptypb.Empty{}, nil
}

func (s *Server) HandlerFinished(ctx context.Context, req *ipc.HandlerFinishedRequest) (*emptypb.Empty, error) {
if err := s.ioClient.UpdateEgress(ctx, req.Info); err != nil {
func (s *Server) HandlerFinished(_ context.Context, req *ipc.HandlerFinishedRequest) (*emptypb.Empty, error) {
if err := s.ioClient.UpdateEgress(context.Background(), req.Info); err != nil {
logger.Errorw("failed to update egress", err)
}

Expand Down
4 changes: 3 additions & 1 deletion test/ioserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ func newIOTestServer(bus psrpc.MessageBus, updates chan *livekit.EgressInfo) (*i
return s, nil
}

func (s *ioTestServer) CreateEgress(_ context.Context, _ *livekit.EgressInfo) (*emptypb.Empty, error) {
func (s *ioTestServer) CreateEgress(_ context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
logger.Infow("egress created", "egressID", info.EgressId)
return &emptypb.Empty{}, nil
}

func (s *ioTestServer) UpdateEgress(_ context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
logger.Infow("egress updated", "egressID", info.EgressId, "status", info.Status)
s.updates <- info
return &emptypb.Empty{}, nil
}
Expand Down

0 comments on commit 9ff7a99

Please sign in to comment.