Skip to content

Commit

Permalink
hls wait when killing proccess group, fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Sep 25, 2021
1 parent 85c6c25 commit 1d8985a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hls/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,12 @@ func (m *ManagerCtx) Stop() {
err := m.cmd.Process.Kill()
m.logger.Err(err).Msg("killing proccess")
}
m.cmd.Wait()
m.cmd = nil
}

time.AfterFunc(2*time.Second, func() {
err := os.RemoveAll(m.tempdir)
m.logger.Err(err).Msg("removing tempdir")
})
err := os.RemoveAll(m.tempdir)
m.logger.Err(err).Msg("removing tempdir")

if m.events.onStop != nil {
m.events.onStop()
Expand Down

0 comments on commit 1d8985a

Please sign in to comment.