summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/http.go b/http.go
index 7534b87..cc19929 100644
--- a/http.go
+++ b/http.go
@@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"strings"
+ "time"
"go.wit.com/log"
)
@@ -83,10 +84,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
var count int
var bad int
- all := me.machines.All()
- for all.Scan() {
- m := all.Next()
+ for m := range me.machines.IterAll() {
count += 1
+ if m.SinceLastUpdate() > 10*time.Minute {
+ // skip machines that have not been updated in the last 10 minutes
+ log.Info("ignoring old machine", m.Hostname)
+ continue
+ }
if findVersion(m, "zood") != me.zood.version {
bad += 1
}