From 5729e484473f52048578af1b80d0008c7024089b Mon Sep 17 00:00:00 2001 From: Alexandre Fiori Date: Mon, 26 Sep 2016 19:17:15 -0400 Subject: [PATCH] Add support for SIGINT (#30) Closes #28. --- gracehttp/http.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gracehttp/http.go b/gracehttp/http.go index 93e26a6..4ba8d28 100644 --- a/gracehttp/http.go +++ b/gracehttp/http.go @@ -98,12 +98,12 @@ func (a *app) term(wg *sync.WaitGroup) { func (a *app) signalHandler(wg *sync.WaitGroup) { ch := make(chan os.Signal, 10) - signal.Notify(ch, syscall.SIGTERM, syscall.SIGUSR2) + signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR2) for { sig := <-ch switch sig { - case syscall.SIGTERM: - // this ensures a subsequent TERM will trigger standard go behaviour of + case syscall.SIGINT, syscall.SIGTERM: + // this ensures a subsequent INT/TERM will trigger standard go behaviour of // terminating. signal.Stop(ch) a.term(wg)