From 615b5367d8c5ca8f9dee36d6a8f54dd1d9594717 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 11 Nov 2019 00:00:05 -0500 Subject: [PATCH] also handle sigterm --- web.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web.go b/web.go index 50f4b55..5cba7a6 100644 --- a/web.go +++ b/web.go @@ -31,6 +31,7 @@ import ( "sort" "strconv" "strings" + "syscall" "time" "github.com/gorilla/mux" @@ -2054,6 +2055,7 @@ var readyalready = make(chan bool) func enditall() { sig := make(chan os.Signal) signal.Notify(sig, os.Interrupt) + signal.Notify(sig, syscall.SIGTERM) <-sig count := 0 log.Printf("stopping...")