mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00
Wait for process to exit when stopping
If a process has some cleanup with purge-on-delete defined, the purge has to wait until the process actually exited. Otherwise it may happen that the process got the signal, files are purged, but the process is still writing some files in order to exit cleanly. This would lead to some artefacts left on the filesystem.
This commit is contained in:
@@ -204,7 +204,7 @@ func (r *restream) Stop() {
|
||||
// Start() they will get restarted.
|
||||
for id, t := range r.tasks {
|
||||
if t.ffmpeg != nil {
|
||||
t.ffmpeg.Stop()
|
||||
t.ffmpeg.Stop(true)
|
||||
}
|
||||
|
||||
r.unsetCleanup(id)
|
||||
@@ -996,7 +996,7 @@ func (r *restream) stopProcess(id string) error {
|
||||
|
||||
task.process.Order = "stop"
|
||||
|
||||
task.ffmpeg.Stop()
|
||||
task.ffmpeg.Stop(true)
|
||||
|
||||
r.nProc--
|
||||
|
||||
@@ -1024,7 +1024,7 @@ func (r *restream) restartProcess(id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
task.ffmpeg.Kill()
|
||||
task.ffmpeg.Kill(true)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user