remove redundant log messages
Signed-off-by: kkkkun <scuzk373x@gmail.com>
This commit is contained in:
@ -23,6 +23,8 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"go.etcd.io/etcd/client/pkg/v3/verify"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -47,6 +49,7 @@ func RegisterInterruptHandler(h InterruptHandler) {
|
||||
|
||||
// HandleInterrupts calls the handler functions on receiving a SIGINT or SIGTERM.
|
||||
func HandleInterrupts(lg *zap.Logger) {
|
||||
verify.Assert(lg != nil, "the logger should not be nil")
|
||||
notifier := make(chan os.Signal, 1)
|
||||
signal.Notify(notifier, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
@ -60,9 +63,7 @@ func HandleInterrupts(lg *zap.Logger) {
|
||||
|
||||
interruptExitMu.Lock()
|
||||
|
||||
if lg != nil {
|
||||
lg.Info("received signal; shutting down", zap.String("signal", sig.String()))
|
||||
}
|
||||
lg.Info("received signal; shutting down", zap.String("signal", sig.String()))
|
||||
|
||||
for _, h := range ihs {
|
||||
h()
|
||||
|
Reference in New Issue
Block a user