diff --git a/core/stats.go b/core/stats.go index ae787456a..cc017cc59 100644 --- a/core/stats.go +++ b/core/stats.go @@ -141,5 +141,11 @@ func getSavedStats() (models.Stats, error) { return result, err } + // If the stats were saved > 5min ago then ignore the + // peak session count value, since the session is over. + if !result.LastDisconnectTime.Valid || time.Since(result.LastDisconnectTime.Time).Minutes() > 5 { + result.SessionMaxViewerCount = 0 + } + return result, err }