Renaming ShutdownSignals -> Shutdown (#1553)

This commit is contained in:
Janos Dobronszki 2020-04-21 14:14:20 +02:00 committed by GitHub
parent e5c215556e
commit 075d7d4fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View File

@ -200,7 +200,8 @@ func Run() error {
} }
ch := make(chan os.Signal, 1) ch := make(chan os.Signal, 1)
signal.Notify(ch, signalutil.ShutdownSignals()...) signal.Notify(ch, signalutil.Shutdown()...)
if logger.V(logger.InfoLevel, log) { if logger.V(logger.InfoLevel, log) {
log.Infof("Received signal %s", <-ch) log.Infof("Received signal %s", <-ch)
} }

View File

@ -210,7 +210,7 @@ func (s *service) Run() error {
ch := make(chan os.Signal, 1) ch := make(chan os.Signal, 1)
if s.opts.Signal { if s.opts.Signal {
signal.Notify(ch, signalutil.ShutdownSignals()...) signal.Notify(ch, signalutil.Shutdown()...)
} }
select { select {

View File

@ -6,7 +6,7 @@ import (
) )
// ShutDownSingals returns all the singals that are being watched for to shut down services. // ShutDownSingals returns all the singals that are being watched for to shut down services.
func ShutdownSignals() []os.Signal { func Shutdown() []os.Signal {
return []os.Signal{ return []os.Signal{
syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGKILL, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGKILL,
} }

View File

@ -404,7 +404,7 @@ func (s *service) Run() error {
ch := make(chan os.Signal, 1) ch := make(chan os.Signal, 1)
if s.opts.Signal { if s.opts.Signal {
signal.Notify(ch, signalutil.ShutdownSignals()...) signal.Notify(ch, signalutil.Shutdown()...)
} }
select { select {