From ccbdef1a1340571110d9867499b0801ff19c681c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 13 Oct 2024 04:34:55 -0500 Subject: checking for the grid to be 'stable' before starting new droplets Signed-off-by: Jeff Carr --- poll.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'poll.go') diff --git a/poll.go b/poll.go index 981bf86..1497509 100644 --- a/poll.go +++ b/poll.go @@ -139,15 +139,15 @@ func clusterHealthy() (bool, string) { if me.killcount > 0 { summary += "(killcount=" + fmt.Sprintf("%d", me.killcount) + ")" } - last := time.Since(me.stable) + last := time.Since(me.unstable) if last > 133*time.Second { // the cluster has not been stable for 10 seconds - s := shell.FormatDuration(last) - summary += "(unstable " + s + ")" + s := strings.TrimSpace(shell.FormatDuration(last)) + summary += "(stable=" + s + ")" } if good { - me.stable = time.Now() return good, "GOOD=true " + summary } + me.unstable = time.Now() return good, "GOOD=false " + summary } -- cgit v1.2.3