mirror of
https://github.com/go-task/task.git
synced 2025-07-01 00:55:05 +02:00
Merge pull request #476 from Pix4D/fix-os-kill
signals: do not try to catch uncatchable signals
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -19,8 +19,9 @@ dist/
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# intellij idea/goland
|
# editors
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
# exuberant ctags
|
# exuberant ctags
|
||||||
tags
|
tags
|
||||||
|
@ -209,7 +209,7 @@ func getArgs() (tasksAndVars, cliArgs []string) {
|
|||||||
|
|
||||||
func getSignalContext() context.Context {
|
func getSignalContext() context.Context {
|
||||||
ch := make(chan os.Signal, 1)
|
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())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
go func() {
|
go func() {
|
||||||
sig := <-ch
|
sig := <-ch
|
||||||
|
Reference in New Issue
Block a user