amend sys HandleSigKill

This commit is contained in:
Mahdi Abu Yasmine 2023-11-03 23:10:43 +01:00
parent 9574b3e083
commit 79ed312ca2

View File

@ -110,9 +110,7 @@ func HandleTermChange() {
}() }()
} }
func HandleSigKill() { func HandleSigKill(done chan os.Signal) {
done := make(chan os.Signal, 1)
defer close(done)
signal.Notify(done, syscall.SIGINT, syscall.SIGTERM) signal.Notify(done, syscall.SIGINT, syscall.SIGTERM)
go func() { go func() {
<-done // Will block here until user hits ctrl+c <-done // Will block here until user hits ctrl+c