From 631bec38d0a5b7d1bf0249740ef9d73ed12badd3 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 6 Nov 2021 01:54:56 +0100 Subject: [PATCH] Actually log timeout --- cmd/apiary.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/apiary.go b/cmd/apiary.go index c61e90a..7647029 100644 --- a/cmd/apiary.go +++ b/cmd/apiary.go @@ -197,6 +197,7 @@ func ActionServe(c *cli.Context) error { loggers.rootLogger.Warnw("Unable to connect to NOTIFY_SOCKET to notify watchdog.", "error", err) return } + loggers.rootLogger.Debug("Sent WATCHDOG=1 to NOTIFY_SOCKET.") // Setup timer timeout, err := daemon.SdWatchdogEnabled(false) @@ -204,10 +205,8 @@ func ActionServe(c *cli.Context) error { loggers.rootLogger.Warnw("Unable to connect to NOTIFY_SOCKET to get watchdog timeout.", "error", err) return } - if timeout < 0 { - loggers.rootLogger.Debugw("Got invalid watchdog timeout", "timeout", timeout) - return - } + loggers.rootLogger.Debugw("Got invalid watchdog timeout", "timeout", timeout) + ticker := time.NewTicker(timeout / 2) for { healthy := s.IsHealthy()