From 19c9f1550ddf29ed2aaaf4d535b1d1feebea61f9 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 4 May 2019 12:45:00 -0500 Subject: [PATCH] Catch SIGTERM to ensure graceful container stopping --- cmd/mc-router/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/mc-router/main.go b/cmd/mc-router/main.go index 8b0cd28..3942832 100644 --- a/cmd/mc-router/main.go +++ b/cmd/mc-router/main.go @@ -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))