Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Do not save invalid disconnect time

Gabe Kangas85df1fe76e38
diff --git a/core/stats.go b/core/stats.go
index 121942f76f..3f716ce9e4 100644
--- a/core/stats.go
+++ b/core/stats.go
@@ -136,8 +136,10 @@ func saveStats() error {
if err := data.SetPeakSessionViewerCount(_stats.SessionMaxViewerCount); err != nil {
log.Errorln("error saving viewer count", err)
}
- if err := data.SetLastDisconnectTime(_stats.LastConnectTime.Time); err != nil {
- log.Errorln("error saving disconnect time", err)
+ if _stats.LastDisconnectTime.Valid {
+ if err := data.SetLastDisconnectTime(_stats.LastConnectTime.Time); err != nil {
+ log.Errorln("error saving disconnect time", err)
+ }
}
return nil