0

Do not save invalid disconnect time

This commit is contained in:
Gabe Kangas 2021-06-29 11:38:13 -07:00
parent 12104978e8
commit 0802a20f4f

View File

@ -136,8 +136,10 @@ func saveStats() error {
if err := data.SetPeakSessionViewerCount(_stats.SessionMaxViewerCount); err != nil { if err := data.SetPeakSessionViewerCount(_stats.SessionMaxViewerCount); err != nil {
log.Errorln("error saving viewer count", err) log.Errorln("error saving viewer count", err)
} }
if err := data.SetLastDisconnectTime(_stats.LastConnectTime.Time); err != nil { if _stats.LastDisconnectTime.Valid {
log.Errorln("error saving disconnect time", err) if err := data.SetLastDisconnectTime(_stats.LastConnectTime.Time); err != nil {
log.Errorln("error saving disconnect time", err)
}
} }
return nil return nil