diff options
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 } |
