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()