mirror of
https://github.com/itzg/mc-router.git
synced 2024-11-21 11:25:41 +01:00
Catch SIGTERM to ensure graceful container stopping
This commit is contained in:
parent
2db4274db2
commit
19c9f1550d
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user