Use a go routine to clean up stats workers. (#836)
* Use a go routine to clean up stats workers. It is possible that certain events (like TrackUnpublished) can happen after the participant is closed. For webhooks pertaining to those events, need details like room name/id. So,reap stats workers a little while after the participant left event happens. * handle data race report * log analytics worker reap * debug log
This commit is contained in:
@@ -1837,8 +1837,11 @@ func (p *ParticipantImpl) handleTrackPublished(track types.MediaTrack) {
|
||||
p.SetMigrateState(types.MigrateStateComplete)
|
||||
}
|
||||
|
||||
if p.onTrackPublished != nil {
|
||||
p.onTrackPublished(p, track)
|
||||
p.lock.RLock()
|
||||
onTrackPublished := p.onTrackPublished
|
||||
p.lock.RUnlock()
|
||||
if onTrackPublished != nil {
|
||||
onTrackPublished(p, track)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user