1
0
mirror of https://github.com/go-task/task.git synced 2025-03-17 21:08:01 +02:00

signals: do not try to catch uncatchable signals

os.Kill is SIGKILL (kill -9), cannot be intercepted.
(see https://github.com/golang/go/issues/13080)
This commit is contained in:
Marco Molteni 2021-04-20 14:57:23 +02:00
parent 2e13cf5f74
commit 837fb71a24

View File

@ -208,7 +208,7 @@ func getArgs() (tasksAndVars, cliArgs []string) {
func getSignalContext() context.Context {
ch := make(chan os.Signal, 1)
signal.Notify(ch, os.Interrupt, os.Kill, syscall.SIGTERM)
signal.Notify(ch, os.Interrupt, syscall.SIGTERM)
ctx, cancel := context.WithCancel(context.Background())
go func() {
sig := <-ch