diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -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) { |
