Rename daemon wait
This commit is contained in:
parent
6764bd3005
commit
6b36d76c31
1 changed files with 6 additions and 3 deletions
|
@ -15,16 +15,19 @@ var (
|
|||
)
|
||||
|
||||
// WaitForSignal waits until one of the specified signals are received.
|
||||
func WaitForSignal(sig ...os.Signal) {
|
||||
func WaitForSignal(sig ...os.Signal) os.Signal {
|
||||
ch := make(chan os.Signal, 1)
|
||||
signal.Notify(ch, sig...)
|
||||
s := <-ch
|
||||
|
||||
log.Debug().
|
||||
Str("signal", s.String()).
|
||||
Msg("Signal caught")
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
// WaitForDefaultSignals waits until one of SIGINT, SIGQUIT or SIGTERM is received.
|
||||
func WaitForDefaultSignals() {
|
||||
// WaitForSignalsDefault waits until one of SIGINT, SIGQUIT or SIGTERM is received.
|
||||
func WaitForSignalsDefault() {
|
||||
WaitForSignal(Interrupt, Quit, Terminate)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue