Browse Source

Don't update viewer counts if a live stream session is not active.

pull/184/head
Gabe Kangas 6 years ago
parent
commit
519be9d3b4
  1. 4
      core/stats.go

4
core/stats.go

@ -88,9 +88,13 @@ func SetClientActive(clientID string) { @@ -88,9 +88,13 @@ func SetClientActive(clientID string) {
l.Lock()
_stats.Clients[clientID] = time.Now()
l.Unlock()
// Don't update viewer counts if a live stream session is not active.
if _stats.StreamConnected {
_stats.SessionMaxViewerCount = int(math.Max(float64(len(_stats.Clients)), float64(_stats.SessionMaxViewerCount)))
_stats.OverallMaxViewerCount = int(math.Max(float64(_stats.SessionMaxViewerCount), float64(_stats.OverallMaxViewerCount)))
}
}
//RemoveClient removes a client from the active clients record
func RemoveClient(clientID string) {

Loading…
Cancel
Save