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 {
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