From 80f25698ba5563202ae48078a5c9fe71c1b42b5d Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 15 Aug 2023 14:24:43 +0200 Subject: chore: update config tests Signed-off-by: Valery Piashchynski --- internal/sdnotify/sdnotify.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/sdnotify/sdnotify.go b/internal/sdnotify/sdnotify.go index d88c0e88..114284ee 100644 --- a/internal/sdnotify/sdnotify.go +++ b/internal/sdnotify/sdnotify.go @@ -96,7 +96,19 @@ func StartWatchdog(interval int, stopCh chan struct{}) { case <-stopCh: return case <-ticker.C: - _, _ = SdNotify(Watchdog) + supported, err := SdNotify(Watchdog) + if err != nil { + // notification supported, but failure happened, retry + continue + } + // notification not supported, stop + if !supported && err == nil { + return + } + // notification supported, data has been sent, continue + if supported && err == nil { + continue + } } } }() -- cgit v1.2.3