Add logging for ActionServe
This commit is contained in:
parent
b70d057cb8
commit
ae21fd8a11
@ -235,12 +235,17 @@ func ActionServe(c *cli.Context) error {
|
||||
|
||||
ticker := time.NewTicker(timeout / 2)
|
||||
for {
|
||||
// TODO: Consider using ctx with deadline to avoid healthcheck taking more time than ticker,
|
||||
// which will result in being killed by watchdog.
|
||||
healthy := s.IsHealthy()
|
||||
select {
|
||||
case <-ticker.C:
|
||||
if healthy == nil {
|
||||
daemon.SdNotify(false, daemon.SdNotifyWatchdog)
|
||||
continue
|
||||
}
|
||||
// TODO: If unhealthy, should we retry healthcheck immediately, otherwise service will most likely get killed by watchdog.
|
||||
loggers.rootLogger.Errorw("Store reported not healthy, might get killed by watchdog.", "err", healthy)
|
||||
case <-notifyCtx.Done():
|
||||
loggers.rootLogger.Debugw("Notify context cancelled.")
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user