mirror of
https://github.com/owncast/owncast.git
synced 2024-11-28 19:19:06 +03:00
Rename functions to be clearer that it is for offline cleanup
This commit is contained in:
parent
d403fd20f1
commit
2d71337146
1 changed files with 6 additions and 6 deletions
|
@ -24,7 +24,7 @@ func SetStreamAsConnected() {
|
||||||
_stats.LastConnectTime = utils.NullTime{time.Now(), true}
|
_stats.LastConnectTime = utils.NullTime{time.Now(), true}
|
||||||
_stats.LastDisconnectTime = utils.NullTime{time.Now(), false}
|
_stats.LastDisconnectTime = utils.NullTime{time.Now(), false}
|
||||||
|
|
||||||
StopCleanupTimer()
|
StopOfflineCleanupTimer()
|
||||||
if _yp != nil {
|
if _yp != nil {
|
||||||
_yp.Start()
|
_yp.Start()
|
||||||
}
|
}
|
||||||
|
@ -111,11 +111,11 @@ func SetStreamAsDisconnected() {
|
||||||
_storage.Save(playlistFilePath, 0)
|
_storage.Save(playlistFilePath, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
StartCleanupTimer()
|
StartOfflineCleanupTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartCleanupTimer will fire a cleanup after n minutes being disconnected
|
// StartOfflineCleanupTimer will fire a cleanup after n minutes being disconnected
|
||||||
func StartCleanupTimer() {
|
func StartOfflineCleanupTimer() {
|
||||||
_cleanupTimer = time.NewTimer(5 * time.Minute)
|
_cleanupTimer = time.NewTimer(5 * time.Minute)
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
|
@ -130,8 +130,8 @@ func StartCleanupTimer() {
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopCleanupTimer will stop the previous cleanup timer
|
// StopOfflineCleanupTimer will stop the previous cleanup timer
|
||||||
func StopCleanupTimer() {
|
func StopOfflineCleanupTimer() {
|
||||||
if _cleanupTimer != nil {
|
if _cleanupTimer != nil {
|
||||||
_cleanupTimer.Stop()
|
_cleanupTimer.Stop()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue