Actually log timeout

This commit is contained in:
Torjus Håkestad 2021-11-06 01:54:56 +01:00
parent 9db21cb15d
commit 631bec38d0

View File

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