Browse Source

Reset session stats when we cleanup the session. Closes #180

pull/184/head
Gabe Kangas 5 years ago
parent
commit
fc45645280
  1. 2
      core/core.go
  2. 5
      core/status.go

2
core/core.go

@ -64,6 +64,8 @@ func startCleanupTimer() { @@ -64,6 +64,8 @@ func startCleanupTimer() {
for {
select {
case <-_cleanupTimer.C:
// Reset the session count since the session is over
_stats.SessionMaxViewerCount = 0
resetDirectories()
ffmpeg.ShowStreamOfflineState()
}

5
core/status.go

@ -33,11 +33,6 @@ func SetStreamAsConnected() { @@ -33,11 +33,6 @@ func SetStreamAsConnected() {
_stats.LastConnectTime = utils.NullTime{time.Now(), true}
_stats.LastDisconnectTime = utils.NullTime{time.Now(), false}
timeSinceDisconnect := time.Since(_stats.LastDisconnectTime.Time).Minutes()
if timeSinceDisconnect > 15 {
_stats.SessionMaxViewerCount = 0
}
chunkPath := config.Config.GetPublicHLSSavePath()
if usingExternalStorage {
chunkPath = config.Config.GetPrivateHLSSavePath()

Loading…
Cancel
Save