Ignore old per-session peak viewer counts when reading stats file.

This commit is contained in:
Gabe Kangas 2020-12-05 15:09:57 -08:00
parent 62d85a8b1d
commit 4a4639a523

View File

@ -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
}