diff options
| author | Jeff Carr <[email protected]> | 2024-02-16 17:55:53 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-16 17:55:53 -0600 |
| commit | c253a30fb61cdc956e1cefb8296e34bf74ddf90c (patch) | |
| tree | fc4b962a2e768866619acce615deaa99fd56dde9 /main.go | |
| parent | bdb761714361a3986834b8b50bb34cce45d01e4d (diff) | |
changing branches works
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 43 |
1 files changed, 24 insertions, 19 deletions
@@ -53,34 +53,39 @@ func main() { // processing is done. update the repo summary box me.summary.Update() - // scan repos every 30 seconds - // check every second for the checkbox changing - var i int = 60 + // scan repos every i seconds + // check every 'delay seconds for the checkbox changing + // this logic is unintuitive because I want it to fluidly + // never tricker quickly but also want to print something + // out that the app is alive since, technically + // the GUI is *NOT* this app and could be alive when + // the application is actually stalled somewhere + // plus these things are fun for me and a distraction when + // I've been working 50 days in a row on this gui code + + // this also means that if you click the checkbox after + // the delay, then the scan will run right away, but if + // you check the checkbox twice in 5 seconds, it won't + // rerun until the delay again + var delay int = 99 + var i int = delay myTicker(1*time.Second, "newScan()", func() { i += 1 - if !me.scanEveryMinute.Checked() { - if i < 60 { - i = 60 + // check if the checkbox is checked + if !me.autoScanReposCB.Checked() { + if i < delay { + i = delay } - // print every 27 seconds - if i%27 == 0 { + // print every 'delay' seconds + if i%delay == 0 { log.Info("Not auto scanning", i) } return } - if i < 60 { + if i < delay { return } i = 0 - timeFunction(func() { - // scanGoSum() - for _, repo := range me.allrepos { - repo.newScan() - } - }) - /* - s := fmt.Sprint(duration) - // me.autoWorkingPwd.SetText(s) - */ + scanRepositories() }) } |
