update 10 at a time
This commit is contained in:
parent
f39125655d
commit
dda5629688
2
control
2
control
|
@ -8,7 +8,7 @@ Maintainer: Jeff Carr <jcarr@wit.com>
|
|||
Architecture: amd64
|
||||
Depends:
|
||||
URL: https://go.wit.com/apps/zookeeper
|
||||
Description: zookeeper for homelab grids
|
||||
Description: manage your homelab cluster
|
||||
keeps track of things in a grid. Maybe
|
||||
this is similar to the apache project by
|
||||
the same name, but in any case, this is
|
||||
|
|
|
@ -59,16 +59,24 @@ func makeZoodWin() *stdTableWin {
|
|||
stdw.versionL = grid.NewLabel("scan")
|
||||
stdw.outOfDate = grid.NewCheckbox("out of date")
|
||||
stdw.showAll = grid.NewCheckbox("all")
|
||||
grid.NewButton("show out of date", func() {
|
||||
found := zoopb.NewMachines()
|
||||
grid.NewButton("upgrade 10", func() {
|
||||
var count int
|
||||
all := me.machines.All()
|
||||
for all.Scan() {
|
||||
m := all.Next()
|
||||
mtime := m.Laststamp.AsTime()
|
||||
if time.Since(mtime) > 10*time.Hour {
|
||||
continue
|
||||
}
|
||||
if m.FindVersion("zood") != me.zood.version {
|
||||
found.Append(m)
|
||||
count += 1
|
||||
m.Upgrade = true
|
||||
log.Info("upgrade", m.Hostname, count)
|
||||
}
|
||||
if count > 9 {
|
||||
return
|
||||
}
|
||||
}
|
||||
stdw.doMachinesUpgradeTable(found)
|
||||
})
|
||||
|
||||
// make a box at the bottom of the window for the protobuf table
|
||||
|
|
Loading…
Reference in New Issue