skip logging retry message when ws disconnections before signal finishes (#2604)

This commit is contained in:
Paul Wells
2024-03-29 06:30:12 -07:00
committed by GitHub
parent 0a35e59ebd
commit f1c991c547
2 changed files with 10 additions and 8 deletions
+1 -5
View File
@@ -219,14 +219,10 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var cr connectionResult
var initialResponse *livekit.SignalResponse
for i := 0; i < 3; i++ {
if err = r.Context().Err(); err != nil {
break
}
connectionTimeout := 3 * time.Second * time.Duration(i+1)
ctx := utils.ContextWithAttempt(r.Context(), i)
cr, initialResponse, err = s.startConnection(ctx, roomName, pi, connectionTimeout)
if err == nil {
if err == nil || errors.Is(err, context.Canceled) {
break
}
if i < 2 {
+9 -3
View File
@@ -162,7 +162,10 @@ func (s *BytesSignalStats) ResolveRoom(ri *livekit.Room) {
s.mu.Lock()
defer s.mu.Unlock()
if s.ri == nil && ri.GetSid() != "" {
s.ri = ri
s.ri = &livekit.Room{
Sid: ri.Sid,
Name: ri.Name,
}
s.maybeStart()
}
}
@@ -170,8 +173,11 @@ func (s *BytesSignalStats) ResolveRoom(ri *livekit.Room) {
func (s *BytesSignalStats) ResolveParticipant(pi *livekit.ParticipantInfo) {
s.mu.Lock()
defer s.mu.Unlock()
if s.pi == nil {
s.pi = pi
if s.pi == nil && pi != nil {
s.pi = &livekit.ParticipantInfo{
Sid: pi.Sid,
Identity: pi.Identity,
}
s.maybeStart()
}
}