diff --git a/cmd/agent/signal.go b/cmd/agent/signal.go index f3362a9a4..41782d7d3 100644 --- a/cmd/agent/signal.go +++ b/cmd/agent/signal.go @@ -26,7 +26,7 @@ func WithContext(ctx context.Context) context.Context { func WithContextFunc(ctx context.Context, f func()) context.Context { ctx, cancel := context.WithCancel(ctx) go func() { - c := make(chan os.Signal) + c := make(chan os.Signal, 1) signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) defer signal.Stop(c) diff --git a/pipeline/interrupt/interrupt.go b/pipeline/interrupt/interrupt.go index 0296d7548..adf79b6f1 100644 --- a/pipeline/interrupt/interrupt.go +++ b/pipeline/interrupt/interrupt.go @@ -20,7 +20,7 @@ func WithContext(ctx context.Context) context.Context { func WithContextFunc(ctx context.Context, f func()) context.Context { ctx, cancel := context.WithCancel(ctx) go func() { - c := make(chan os.Signal) + c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) defer signal.Stop(c)