Suppress negotiation timout log if signal disconnect (#1433)
* Suppress negotiation timout log if signal disconnect * solve comment
This commit is contained in:
@@ -1962,7 +1962,9 @@ func (p *ParticipantImpl) onSubscriptionError(trackID livekit.TrackID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
|
func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
|
||||||
p.params.Logger.Infow("negotiation failed, starting full reconnect")
|
if p.TransportManager.SinceLastSignal() < negotiationFailedTimeout {
|
||||||
|
p.params.Logger.Infow("negotiation failed, starting full reconnect")
|
||||||
|
}
|
||||||
p.IssueFullReconnect(types.ParticipantCloseReasonNegotiateFailed)
|
p.IssueFullReconnect(types.ParticipantCloseReasonNegotiateFailed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -717,3 +717,9 @@ func (t *TransportManager) UpdateLastSeenSignal() {
|
|||||||
t.lastSignalAt = time.Now()
|
t.lastSignalAt = time.Now()
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *TransportManager) SinceLastSignal() time.Duration {
|
||||||
|
t.lock.RLock()
|
||||||
|
defer t.lock.RUnlock()
|
||||||
|
return time.Since(t.lastSignalAt)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user