mirror of https://github.com/docker/compose.git
Use buffered channels for signals
This commit is contained in:
parent
9a29037e0f
commit
88c405e025
|
@ -226,7 +226,7 @@ func checkIfUnknownCommandExistInDefaultContext(err error, currentContext string
|
|||
|
||||
func newSigContext() (context.Context, func()) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
s := make(chan os.Signal)
|
||||
s := make(chan os.Signal, 1)
|
||||
signal.Notify(s, syscall.SIGTERM, syscall.SIGINT)
|
||||
go func() {
|
||||
<-s
|
||||
|
|
|
@ -62,7 +62,7 @@ func Exec() {
|
|||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
signals := make(chan os.Signal)
|
||||
signals := make(chan os.Signal, 1)
|
||||
childExit := make(chan bool)
|
||||
signal.Notify(signals) // catch all signals
|
||||
go func() {
|
||||
|
|
Loading…
Reference in New Issue