summaryrefslogtreecommitdiff
path: root/poll.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-28 07:02:42 -0500
committerJeff Carr <[email protected]>2024-10-28 07:02:42 -0500
commitde5f5c6a85b14810cca87bd89e439ce52698f965 (patch)
tree2746148fad9fbfd5ea7e6791b12bd3b3135f3717 /poll.go
parent3f7171fff2898deef6a8f1d5180ea11217123324 (diff)
grid stable might be working
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'poll.go')
-rw-r--r--poll.go13
1 files 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
}