We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 240e09f commit 9e3b3f9Copy full SHA for 9e3b3f9
1 file changed
exit/listen.go
@@ -30,8 +30,17 @@ func Listen(fn func(os.Signal)) {
30
var sig os.Signal
31
select {
32
case sig = <-sigchan:
33
- if sig == syscall.SIGHUP {
+ switch sig {
34
+ case syscall.SIGHUP:
35
+ log.Print("[INFO] Caught SIGHUP. Ignoring")
36
continue
37
+ case os.Interrupt:
38
+ log.Print("[INFO] Caught SIGINT. Exiting")
39
+ case syscall.SIGTERM:
40
+ log.Print("[INFO] Caught SIGTERM. Exiting")
41
+ default:
42
+ // fallthrough in case we forgot to add a switch clause.
43
+ log.Printf("[INFO] Caught signal %v. Exiting", sig)
44
}
45
case <-quit:
46
0 commit comments