Fix potential concurrent access condition
This commit is contained in:
parent
3c6fcb0de5
commit
f782e82909
@ -100,6 +100,9 @@ func SetViewerIdActive(id string) {
|
||||
func pruneViewerCount() {
|
||||
viewers := make(map[string]time.Time)
|
||||
|
||||
l.Lock()
|
||||
defer l.Unlock()
|
||||
|
||||
for viewerId := range _stats.Viewers {
|
||||
viewerLastSeenTime := _stats.Viewers[viewerId]
|
||||
if time.Since(viewerLastSeenTime) < _activeViewerPurgeTimeout {
|
||||
|
Loading…
Reference in New Issue
Block a user