summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-05 14:18:24 -0600
committerJeff Carr <[email protected]>2024-12-05 14:18:24 -0600
commit6b3dd9771387a4f7b2d12c1bc0f4bdd11fe0cc5d (patch)
tree164c0c8d29fc2f8daafb13af017e8464da9d5db4
parentc275e762c6aeb68b300a41aa8bb4a65b22233867 (diff)
yet another attempt at doReleaseAll()v0.22.32
-rw-r--r--releaseBox.go62
1 files changed, 36 insertions, 26 deletions
diff --git a/releaseBox.go b/releaseBox.go
index 8981a53..ba46c2b 100644
--- a/releaseBox.go
+++ b/releaseBox.go
@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"strings"
+ "time"
"go.wit.com/gui"
"go.wit.com/log"
@@ -138,36 +139,15 @@ func createReleaseBox(box *gui.Node) {
group = me.release.box.NewGroup("Process against all repos")
grid = group.NewGrid("buildOptions", 0, 0)
grid.NewButton("doRelease() 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
- duration := repolist.TimeFunction(func() {
- loop := me.repos.View.ReposSortByName()
- for loop.Scan() {
- loop.Repo()
- if doRelease() {
- log.Info("doRelease() worked")
- } else {
- if os.Getenv("FindNextDone") == "true" {
- log.Info("findNext says it was done")
- log.Info("findNext says it was done")
- log.Info("we can os.Exit here")
- }
- if me.release.status.String() == "ALL DONE?" {
- log.Info("maybe ALL DONE?")
- buttonEnable()
- worked = true
- // os.Exit(0)
- }
- log.Info("doRelease() failed")
- worked = false
- break
- }
- }
- })
+ ok, duration := doReleaseAll()
s := fmt.Sprint(duration)
- log.Info("release returned", worked, "and ran for", s)
+ log.Info("release returned", ok, "and ran for", s, "findCounter =", findCounter)
+ if findCounter != 0 {
+ log.Info("should try thsi doRelease() loop again since findCounter =", findCounter)
+ }
buttonEnable()
})
grid.NextRow()
@@ -231,6 +211,36 @@ func createReleaseBox(box *gui.Node) {
grid.NextRow()
}
+func doReleaseAll() (bool, time.Duration) {
+ var worked bool = true
+ findCounter = 0
+ duration := repolist.TimeFunction(func() {
+ loop := me.repos.View.ReposSortByName()
+ for loop.Scan() {
+ loop.Repo()
+ if doRelease() {
+ log.Info("doRelease() worked. findCounter =", findCounter)
+ } else {
+ if os.Getenv("FindNextDone") == "true" {
+ log.Info("findNext says it was done. findCounter =", findCounter)
+ log.Info("findNext says it was done. findCounter =", findCounter)
+ log.Info("we can os.Exit here")
+ }
+ if me.release.status.String() == "ALL DONE?" {
+ log.Info("maybe ALL DONE?. findCounter =", findCounter)
+ buttonEnable()
+ worked = true
+ // os.Exit(0)
+ }
+ log.Info("doRelease() failed. findCounter =", findCounter)
+ worked = false
+ break
+ }
+ }
+ })
+ return worked, duration
+}
+
func buttonDisable() {
me.Disable()
me.release.box.Disable()