Rename daemon wait

This commit is contained in:
Søren Rasmussen 2022-04-05 21:05:40 +02:00
parent 6764bd3005
commit 6b36d76c31

View file

@ -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)
}