aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2023-03-04 15:23:29 +0100
committerGitHub <noreply@github.com>2023-03-04 15:23:29 +0100
commitc038e5d44c05ec6e186b305bb89f57463da64532 (patch)
tree0de49f0e36d4fc154338b1e7e21a7eca6c5f5f87
parent852380f2212a41342cb5440d13cf723ae50b61ea (diff)
parent42aea2cd59e57d70d535227729ea9d0fa68695f7 (diff)
downloadgit-bug-c038e5d44c05ec6e186b305bb89f57463da64532.tar.gz
Merge pull request #1030 from MichaelMure/webui-sigterm
webui: also teardown cleanly on SIGTERM
-rw-r--r--commands/webui.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/webui.go b/commands/webui.go
index 3129a222..96cdbad6 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