Add SIGKILL to shutdown signals (#1552)

* Add SIGKILL to shutdown signals

* go mod tidy

* Add missing file
This commit is contained in:
Janos Dobronszki
2020-04-21 14:00:12 +02:00
committed by GitHub
parent 7c31edd5f8
commit e5c215556e
4 changed files with 19 additions and 6 deletions

View File

@@ -6,7 +6,6 @@ import (
"runtime"
"strings"
"sync"
"syscall"
"github.com/micro/go-micro/v2/auth"
"github.com/micro/go-micro/v2/client"
@@ -18,6 +17,7 @@ import (
"github.com/micro/go-micro/v2/plugin"
"github.com/micro/go-micro/v2/server"
"github.com/micro/go-micro/v2/store"
signalutil "github.com/micro/go-micro/v2/util/signal"
"github.com/micro/go-micro/v2/util/wrapper"
)
@@ -210,7 +210,7 @@ func (s *service) Run() error {
ch := make(chan os.Signal, 1)
if s.opts.Signal {
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
signal.Notify(ch, signalutil.ShutdownSignals()...)
}
select {