Fix timeout handing in StopEgress (#3876)

This commit is contained in:
Benjamin Pracht
2025-08-25 10:34:26 -07:00
committed by GitHub
parent d62336e1a6
commit dc3a775350
+2 -3
View File
@@ -310,8 +310,7 @@ func (s *EgressService) ListEgress(ctx context.Context, req *livekit.ListEgressR
return s.io.ListEgress(ctx, req) return s.io.ListEgress(ctx, req)
} }
func (s *EgressService) StopEgress(ctx context.Context, req *livekit.StopEgressRequest) (*livekit.EgressInfo, error) { func (s *EgressService) StopEgress(ctx context.Context, req *livekit.StopEgressRequest) (info *livekit.EgressInfo, err error) {
var err error
defer func() { defer func() {
if errors.Is(err, psrpc.ErrNoResponse) { if errors.Is(err, psrpc.ErrNoResponse) {
// Do not map cases where the context times out to 503 // Do not map cases where the context times out to 503
@@ -328,7 +327,7 @@ func (s *EgressService) StopEgress(ctx context.Context, req *livekit.StopEgressR
return nil, ErrEgressNotConnected return nil, ErrEgressNotConnected
} }
info, err := s.client.StopEgress(ctx, req.EgressId, req) info, err = s.client.StopEgress(ctx, req.EgressId, req)
if err != nil { if err != nil {
var loadErr error var loadErr error
info, loadErr = s.io.GetEgress(ctx, &rpc.GetEgressRequest{EgressId: req.EgressId}) info, loadErr = s.io.GetEgress(ctx, &rpc.GetEgressRequest{EgressId: req.EgressId})