diff --git a/cmd/mokapi/main.go b/cmd/mokapi/main.go index 587d1d99d..c0733da42 100644 --- a/cmd/mokapi/main.go +++ b/cmd/mokapi/main.go @@ -4,11 +4,16 @@ import ( "context" "mokapi/pkg/cmd/mokapi" "os" + "os/signal" + "syscall" ) func main() { + ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT) + defer stop() + cmd := mokapi.NewCmdMokapi() - err := cmd.ExecuteWithContext(context.Background()) + err := cmd.ExecuteWithContext(ctx) if err != nil { _, _ = os.Stderr.Write([]byte(err.Error())) }