From 9b1efe60b44116afcc93d813b5605d0853fd9ab9 Mon Sep 17 00:00:00 2001 From: Orpheus Lummis Date: Fri, 5 May 2023 21:03:15 +0000 Subject: [PATCH] fix: CLI `start` to handle SIGTERM signal --- cli/start.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/start.go b/cli/start.go index 347f5c9230..b830a79b9a 100644 --- a/cli/start.go +++ b/cli/start.go @@ -18,6 +18,7 @@ import ( "os" "os/signal" "strings" + "syscall" badger "github.com/dgraph-io/badger/v3" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" @@ -384,7 +385,7 @@ func start(ctx context.Context, cfg *config.Config) (*defraInstance, error) { func wait(ctx context.Context, di *defraInstance) error { // setup signal handlers signalCh := make(chan os.Signal, 1) - signal.Notify(signalCh, os.Interrupt) + signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM) select { case <-ctx.Done():