From 1f757d26ff6feb54e50844ece059ff220ff18a49 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 26 Jan 2024 02:04:19 -0600 Subject: 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 --- main.go | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'main.go') 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) { -- cgit v1.2.3