From 42aea2cd59e57d70d535227729ea9d0fa68695f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Sat, 4 Mar 2023 14:59:31 +0100 Subject: [PATCH] webui: also teardown cleanly on SIGTERM --- commands/webui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/webui.go b/commands/webui.go index 3129a222abce5836b894a7c887c4287dde3fe0f6..96cdbad67f9f94c06c42544569eee4d8fb3b3513 100644 --- a/commands/webui.go +++ b/commands/webui.go @@ -12,6 +12,7 @@ import ( "os" "os/signal" "strconv" + "syscall" "time" "github.com/99designs/gqlgen/graphql/playground" @@ -136,7 +137,7 @@ func runWebUI(env *execenv.Env, opts webUIOptions) error { quit := make(chan os.Signal, 1) // register as handler of the interrupt signal to trigger the teardown - signal.Notify(quit, os.Interrupt) + signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) go func() { <-quit