Skip to content

Commit

Permalink
actually wait
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Dec 7, 2023
1 parent f5b04ad commit b1665f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/service/service_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"gopkg.in/yaml.v3"

"github.com/livekit/egress/pkg/config"
"github.com/livekit/egress/pkg/errors"
"github.com/livekit/protocol/egress"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
Expand Down Expand Up @@ -139,7 +140,13 @@ func (s *Service) launchHandler(req *rpc.StartEgressRequest, info *livekit.Egres
}

s.AddHandler(req.EgressId, h)
return nil

select {
case <-h.ready:
return nil
case <-time.After(10 * time.Second):
return errors.ErrEgressNotFound
}
}

func (s *Service) AddHandler(egressID string, h *Process) {
Expand Down

0 comments on commit b1665f2

Please sign in to comment.