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

@@ -5,13 +5,13 @@ import (
"context"
"os"
"os/signal"
"syscall"
"time"
"github.com/google/uuid"
"github.com/micro/go-micro/v2/codec"
"github.com/micro/go-micro/v2/logger"
"github.com/micro/go-micro/v2/registry"
signalutil "github.com/micro/go-micro/v2/util/signal"
)
// Server is a simple micro server abstraction
@@ -200,7 +200,7 @@ func Run() error {
}
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT)
signal.Notify(ch, signalutil.ShutdownSignals()...)
if logger.V(logger.InfoLevel, log) {
log.Infof("Received signal %s", <-ch)
}