Catch SIGTERM to ensure graceful container stopping
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user