From 339e2fa0b50b9347957098014b6b7a4062cf8eba Mon Sep 17 00:00:00 2001 From: David Colburn Date: Wed, 15 May 2024 23:44:03 -0400 Subject: [PATCH] update processEnded --- pkg/server/server_rpc.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/server/server_rpc.go b/pkg/server/server_rpc.go index fb098edc..27fa39a2 100644 --- a/pkg/server/server_rpc.go +++ b/pkg/server/server_rpc.go @@ -137,18 +137,15 @@ func (s *Server) launchProcess(req *rpc.StartEgressRequest, info *livekit.Egress func (s *Server) processEnded(req *rpc.StartEgressRequest, info *livekit.EgressInfo, err error) { if err != nil { + // should only happen if process failed catashrophically now := time.Now().UnixNano() info.UpdatedAt = now info.EndedAt = now info.Status = livekit.EgressStatus_EGRESS_FAILED - if info.Error == "" { - info.Error = "internal error" - info.ErrorCode = int32(http.StatusInternalServerError) - } + info.Error = "internal error" + info.ErrorCode = int32(http.StatusInternalServerError) _, _ = s.ioClient.UpdateEgress(context.Background(), info) - if info.Error == "internal error" { - s.Shutdown(false) - } + s.Shutdown(false) } avgCPU, maxCPU := s.monitor.EgressEnded(req)