Close file when stream went offline so file can be moved

This commit is contained in:
Yami Odymel 2024-01-25 08:35:21 +08:00
parent d71f0656e8
commit 4350359f90
No known key found for this signature in database
GPG Key ID: 68E469836934DB36

View File

@ -91,6 +91,12 @@ func (w *Channel) Run() {
}
w.IsOnline = false
// close file when offline so user can move/delete it
if w.file != nil {
w.file.Close()
w.file = nil
}
w.log(logTypeInfo, "channel is offline, check again 1 min later")
<-time.After(1 * time.Minute) // 1 minute cooldown to check online status
}