store active stats workers in list (#2690)

* store active stats workers in list

* test

* single node cleanup

* cleanup

* cleanup

* cleanup
This commit is contained in:
Paul Wells
2024-04-26 17:24:10 -07:00
committed by GitHub
parent 15ffb53df9
commit ac1b0e38ca
3 changed files with 81 additions and 72 deletions
+1 -2
View File
@@ -163,10 +163,9 @@ func (t *telemetryService) ParticipantLeft(ctx context.Context,
isConnected := false
if worker, ok := t.getWorker(livekit.ParticipantID(participant.Sid)); ok {
isConnected = worker.IsConnected()
if worker.ClosedAt().IsZero() {
if worker.Close() {
prometheus.SubParticipant()
}
worker.Close()
}
if isConnected && shouldSendEvent {