Isolate ffmpeg process group

This commit is contained in:
Thales Maciel 2026-02-06 18:55:13 -03:00
parent d124bfa24c
commit 49ef349d48
2 changed files with 5 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import (
"os/exec"
"path/filepath"
"sync"
"syscall"
"time"
"lel/internal/aiprocess"
@ -194,7 +195,7 @@ func (d *Daemon) stopAndProcess(reason string) {
d.log.Printf("stopping recording (%s)", reason)
if cmd.Process != nil {
_ = cmd.Process.Signal(os.Interrupt)
_ = syscall.Kill(-cmd.Process.Pid, syscall.SIGINT)
}
_ = audio.WaitWithTimeout(cmd, 5*time.Second)