Skip to content

Commit 19c9f15

Browse files
committed
Catch SIGTERM to ensure graceful container stopping
1 parent 2db4274 commit 19c9f15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/mc-router/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"runtime/pprof"
1313
"strconv"
1414
"strings"
15+
"syscall"
1516
)
1617

1718
var (
@@ -59,7 +60,7 @@ func main() {
5960
ctx, cancel := context.WithCancel(context.Background())
6061

6162
c := make(chan os.Signal, 1)
62-
signal.Notify(c, os.Interrupt)
63+
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
6364

6465
server.Routes.RegisterAll(parseMappings(*mappings))
6566

0 commit comments

Comments
 (0)