From 29614cd4a189306177f5b034225723cd3c2b7ed0 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Mon, 10 Jun 2024 16:11:11 -0700 Subject: [PATCH] clean up egress launcher (#2779) --- pkg/rtc/egress.go | 1 - pkg/service/clients.go | 24 ++++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/pkg/rtc/egress.go b/pkg/rtc/egress.go index db6d12813..b3fc017a3 100644 --- a/pkg/rtc/egress.go +++ b/pkg/rtc/egress.go @@ -29,7 +29,6 @@ import ( type EgressLauncher interface { StartEgress(context.Context, *rpc.StartEgressRequest) (*livekit.EgressInfo, error) - StartEgressWithClusterId(ctx context.Context, clusterId string, req *rpc.StartEgressRequest) (*livekit.EgressInfo, error) } func StartParticipantEgress( diff --git a/pkg/service/clients.go b/pkg/service/clients.go index 05c05ca7a..9fd887878 100644 --- a/pkg/service/clients.go +++ b/pkg/service/clients.go @@ -54,7 +54,16 @@ func NewEgressLauncher(client rpc.EgressClient, io IOClient) rtc.EgressLauncher } func (s *egressLauncher) StartEgress(ctx context.Context, req *rpc.StartEgressRequest) (*livekit.EgressInfo, error) { - info, err := s.StartEgressWithClusterId(ctx, "", req) + if s.client == nil { + return nil, ErrEgressNotConnected + } + + // Ensure we have an Egress ID + if req.EgressId == "" { + req.EgressId = guid.New(utils.EgressPrefix) + } + + info, err := s.client.StartEgress(ctx, "", req) if err != nil { return nil, err } @@ -66,16 +75,3 @@ func (s *egressLauncher) StartEgress(ctx context.Context, req *rpc.StartEgressRe return info, nil } - -func (s *egressLauncher) StartEgressWithClusterId(ctx context.Context, clusterId string, req *rpc.StartEgressRequest) (*livekit.EgressInfo, error) { - if s.client == nil { - return nil, ErrEgressNotConnected - } - - // Ensure we have an Egress ID - if req.EgressId == "" { - req.EgressId = guid.New(utils.EgressPrefix) - } - - return s.client.StartEgress(ctx, clusterId, req) -}