summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-26 02:04:19 -0600
committerJeff Carr <[email protected]>2024-01-26 02:04:19 -0600
commit1f757d26ff6feb54e50844ece059ff220ff18a49 (patch)
tree78f7d5cc17a0004e1d60852579134006604ba3a7 /main.go
parent4773d43cf6a39c6d6efdf1703adbe4db8707330e (diff)
allow scan every minute
move go mod status into repostatus working on improving logic of which package to release next Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go33
1 files changed, 30 insertions, 3 deletions
diff --git a/main.go b/main.go
index a2f89db..e4d3115 100644
--- a/main.go
+++ b/main.go
@@ -3,8 +3,10 @@ package main
import (
"embed"
+ "fmt"
"os/user"
"strings"
+ "time"
"go.wit.com/log"
@@ -28,9 +30,34 @@ func main() {
autotypistWindow()
repoworld()
- // keeps the app alive
- // TODO: rescan the status of the repos every so often?
- gui.Watchdog()
+ // scan repos every 30 seconds
+ // check every second for the checkbox changing
+ var i int = 60
+ myTicker(1 * time.Second, "newScan()", func() {
+ i += 1
+ if ! me.scanEveryMinute.Checked() {
+ if i < 60 {
+ i = 60
+ }
+ // print every 13 seconds
+ if i%13 == 0 {
+ log.Info("Not auto scanning", i)
+ }
+ return
+ }
+ if i < 60 {
+ return
+ }
+ i = 0
+ duration := timeFunction(func() {
+ scanGoSum()
+ for _, repo := range me.allrepos {
+ repo.newScan()
+ }
+ })
+ s := fmt.Sprint(duration)
+ me.autoWorkingPwd.SetText(s)
+ })
}
func addRepo(grid *gui.Node, path string, master string, devel string, user string) {