From de5f5c6a85b14810cca87bd89e439ce52698f965 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 28 Oct 2024 07:02:42 -0500 Subject: [PATCH] grid stable might be working Signed-off-by: Jeff Carr --- poll.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/poll.go b/poll.go index 1fa5d58..c429207 100644 --- a/poll.go +++ b/poll.go @@ -99,8 +99,14 @@ func (h *HyperT) pollHypervisor() { log.Info("droplet has probably powered down", name) d := findDroplet(name) if d != nil { - d.CurrentState = pb.DropletState_UNKNOWN - log.Info("set state UNKNOWN here", name) + if d.CurrentState != pb.DropletState_UNKNOWN { + d.CurrentState = pb.DropletState_UNKNOWN + log.Info("set state UNKNOWN here", name) + } else { + if dur > time.Minute { + log.Info("UNKNOWN state for more than one minute remove map entry here?", name) + } + } } } } @@ -185,9 +191,10 @@ func uptimeCheck() (bool, string) { for _, d := range missing { summary += fmt.Sprint("\nmissing droplet: ", d.Hostname, " current state ", d.CurrentState) } + summary += fmt.Sprint("\ngrid stable for: ", shell.FormatDuration(time.Since(me.unstable))) if good { return good, "GOOD=true " + summary } - me.unstable = time.Now() + // me.unstable = time.Now() return good, "GOOD=false " + summary }