Catch SIGTERM to ensure graceful container stopping

This commit is contained in:
Geoff Bourne 2019-05-04 12:45:00 -05:00
parent 2db4274db2
commit 19c9f1550d

View File

@ -12,6 +12,7 @@ import (
"runtime/pprof"
"strconv"
"strings"
"syscall"
)
var (
@ -59,7 +60,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
server.Routes.RegisterAll(parseMappings(*mappings))