Log if timeout is invalid
This commit is contained in:
parent
a1526c9334
commit
056ac87eee
@ -196,7 +196,6 @@ func ActionServe(c *cli.Context) error {
|
||||
loggers.rootLogger.Warnw("Unable to connect to NOTIFY_SOCKET to notify watchdog.", "error", err)
|
||||
return
|
||||
}
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
// Setup timer
|
||||
timeout, err := daemon.SdWatchdogEnabled(false)
|
||||
@ -204,7 +203,10 @@ func ActionServe(c *cli.Context) error {
|
||||
loggers.rootLogger.Warnw("Unable to connect to NOTIFY_SOCKET to get watchdog timeout.", "error", err)
|
||||
return
|
||||
}
|
||||
loggers.rootLogger.Debugw("Got timeout", "timeout", timeout)
|
||||
if timeout < 0 {
|
||||
loggers.rootLogger.Debugw("Got invalid watchdog timeout", "timeout", timeout)
|
||||
return
|
||||
}
|
||||
ticker := time.NewTicker(timeout / 2)
|
||||
for {
|
||||
healthy := s.IsHealthy()
|
||||
|
Loading…
Reference in New Issue
Block a user