Fix unbuffered os.Signal channel error

This commit is contained in:
Kioubit 2021-12-27 06:37:08 -05:00
parent 11110fb66b
commit 5a901eada3

View File

@ -11,7 +11,7 @@ import (
// WaitForSignal Waits (blocking) for the program to be interrupted by the OS
func WaitForSignal() {
var sigCh = make(chan os.Signal)
var sigCh = make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)
<-sigCh
close(sigCh)