grid stable might be working

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-28 07:02:42 -05:00
parent 3f7171fff2
commit de5f5c6a85
1 changed files with 10 additions and 3 deletions

13
poll.go
View File

@ -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
}