time the run

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-14 16:20:26 -06:00
parent b8b65a9c0e
commit dc2b16840e
1 changed files with 20 additions and 12 deletions

View File

@ -2,6 +2,7 @@
package main
import (
"fmt"
"os"
"path/filepath"
@ -28,7 +29,7 @@ type releaseStruct struct {
// widgetVersionS string
releaseVersionB *gui.Node
// unreleaseB *gui.Node
reason *gadgets.BasicEntry
reason *gadgets.BasicEntry
// reasonS string
openrepo *gui.Node
@ -193,22 +194,29 @@ func createReleaseBox(box *gui.Node) {
})
release.grid.NewButton("release all", func() {
var worked bool = true
buttonDisable()
// rather than loop forever, at least limit this to the number of repos
// incase something, somewhere, goes wrong
for n := 0; n <= len(me.allrepos); n++ {
if doRelease() {
log.Info("doRelease() worked")
} else {
if release.status.String() == "ALL DONE?" {
log.Info("maybe ALL DONE?")
buttonEnable()
return
duration := timeFunction(func() {
for n := 0; n <= len(me.allrepos); n++ {
if doRelease() {
log.Info("doRelease() worked")
} else {
if release.status.String() == "ALL DONE?" {
log.Info("maybe ALL DONE?")
buttonEnable()
worked = true
break
}
log.Info("doRelease() failed")
worked = false
break
}
log.Info("doRelease() failed")
return
}
}
})
s := fmt.Sprint(duration)
log.Info("release returned", worked, "and ran for", s)
buttonEnable()
})
}