summaryrefslogtreecommitdiff
path: root/poll.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-13 03:49:54 -0500
committerJeff Carr <[email protected]>2024-10-13 03:49:54 -0500
commit425e75d388beb3f00e527e89ef81a35fd5b6e931 (patch)
tree1e844883e716a8ee2f55478443b523e3b21ae85b /poll.go
parentffe754a96a68e7cf8905344073e3b1eedb78e94b (diff)
trigger start over http
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'poll.go')
-rw-r--r--poll.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/poll.go b/poll.go
index f7f2414..981bf86 100644
--- a/poll.go
+++ b/poll.go
@@ -136,8 +136,17 @@ func clusterHealthy() (bool, string) {
}
summary = strings.TrimSpace(summary)
summary += ")"
- summary += "(killcount=" + fmt.Sprintf("%d", me.killcount) + ")"
+ if me.killcount > 0 {
+ summary += "(killcount=" + fmt.Sprintf("%d", me.killcount) + ")"
+ }
+ last := time.Since(me.stable)
+ if last > 133*time.Second {
+ // the cluster has not been stable for 10 seconds
+ s := shell.FormatDuration(last)
+ summary += "(unstable " + s + ")"
+ }
if good {
+ me.stable = time.Now()
return good, "GOOD=true " + summary
}
return good, "GOOD=false " + summary