Buffered channel for signal interrupt

This commit is contained in:
Alex Eidt 2022-04-16 11:47:41 -07:00
parent 1c933691ff
commit 3e62223de3
3 changed files with 3 additions and 3 deletions

View file

@ -154,7 +154,7 @@ func (video *Video) Close() {
// Stops the "cmd" process running when the user presses Ctrl+C.
// https://stackoverflow.com/questions/11268943/is-it-possible-to-capture-a-ctrlc-signal-and-run-a-cleanup-function-in-a-defe.
func (video *Video) cleanup() {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c