prevent race in telemetry worker cleanup (#2879)

This commit is contained in:
Paul Wells
2024-07-18 03:37:45 -07:00
committed by GitHub
parent e3597d780d
commit afda860162
2 changed files with 10 additions and 2 deletions
+6
View File
@@ -128,6 +128,12 @@ func (s *StatsWorker) Close() bool {
return ok
}
func (s *StatsWorker) Closed() bool {
s.lock.Lock()
defer s.lock.Unlock()
return !s.closedAt.IsZero()
}
func (s *StatsWorker) collectStats(
ts *timestamppb.Timestamp,
streamType livekit.StreamType,