Fix incorrect accounting for track published/subscribed stats. (#1336)
It was not getting decremented in certain cases.
This commit is contained in:
+7
-10
@@ -1611,16 +1611,13 @@ func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *liv
|
||||
p.supervisor.ClearPublishedTrack(livekit.TrackID(ti.Sid), mt)
|
||||
|
||||
// not logged when closing
|
||||
if !p.isClosed.Load() {
|
||||
p.params.Telemetry.TrackUnpublished(
|
||||
context.Background(),
|
||||
p.ID(),
|
||||
p.Identity(),
|
||||
mt.ToProto(),
|
||||
true,
|
||||
)
|
||||
}
|
||||
p.MigrateState()
|
||||
p.params.Telemetry.TrackUnpublished(
|
||||
context.Background(),
|
||||
p.ID(),
|
||||
p.Identity(),
|
||||
mt.ToProto(),
|
||||
!p.IsClosed(),
|
||||
)
|
||||
|
||||
// re-use track sid
|
||||
p.pendingTracksLock.Lock()
|
||||
|
||||
Reference in New Issue
Block a user