Skip to content

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

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

Gabe Kangasfedd18316daa
diff --git a/core/core.go b/core/core.go
index 01de48da3f..be3fd4e049 100644
--- a/core/core.go
+++ b/core/core.go
@@ -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()
}
diff --git a/core/status.go b/core/status.go
index c512915f04..cd720667ce 100644
--- a/core/status.go
+++ b/core/status.go
@@ -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()