forked from Elara6331/itd
		
	Fix bug where itctl doesn't exit on SIGINT/SIGTERM
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| package main | ||||
|  | ||||
| import ( | ||||
| 	"time" | ||||
| 	"context" | ||||
| 	"os" | ||||
| 	"os/signal" | ||||
| @@ -24,6 +25,13 @@ func main() { | ||||
| 		syscall.SIGTERM, | ||||
| 	) | ||||
| 	 | ||||
| 	// This goroutine ensures that itc | ||||
| 	go func() { | ||||
| 		<-ctx.Done() | ||||
| 		time.Sleep(200*time.Millisecond) | ||||
| 		os.Exit(0) | ||||
| 	}() | ||||
|  | ||||
| 	app := cli.App{ | ||||
| 		Name: "itctl", | ||||
| 		HideHelpCommand: true, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user