From 6b36d76c31aefbe25a4af7c5faa94922e7cb04d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Rasmussen?= Date: Tue, 5 Apr 2022 21:05:40 +0200 Subject: [PATCH] Rename daemon wait --- daemon/wait.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/daemon/wait.go b/daemon/wait.go index 641dfaa..83d3001 100644 --- a/daemon/wait.go +++ b/daemon/wait.go @@ -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) }