From 9ff7a999daf139ebb63e5ed6a5c4e7f6ba1a022d Mon Sep 17 00:00:00 2001 From: David Colburn Date: Mon, 23 Sep 2024 18:17:05 -0700 Subject: [PATCH] fix context cancel by grpc --- pkg/server/server_ipc.go | 8 ++++---- test/ioserver.go | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/server/server_ipc.go b/pkg/server/server_ipc.go index 8fd0c623..393c83a4 100644 --- a/pkg/server/server_ipc.go +++ b/pkg/server/server_ipc.go @@ -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) } @@ -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) } diff --git a/test/ioserver.go b/test/ioserver.go index 73247967..5c568943 100644 --- a/test/ioserver.go +++ b/test/ioserver.go @@ -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 }