diff options
| author | Jeff Carr <[email protected]> | 2024-02-24 23:14:02 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-24 23:14:02 -0600 |
| commit | 3aaadf03f036aeb92c77d483cfc13053ca265350 (patch) | |
| tree | 957a3ecb42f480d7b18442478897fc36e545ed64 | |
| parent | 14166cf960763c346714dfe061f55c9c7cdd66a3 (diff) | |
prep to refactor all this codev0.21.2
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | ticker.go | 53 |
2 files changed, 3 insertions, 56 deletions
@@ -11,12 +11,12 @@ redomod: build-release: - go get -v -u -x . - go build -v + GO111MODULE=off go get -v -u -x . + GO111MODULE=off go build -v ./control-panel-droplet build: - go get -v -x . + GO111MODULE=off go get -v -x . GO111MODULE=off go build -v update: diff --git a/ticker.go b/ticker.go deleted file mode 100644 index 90dac8f..0000000 --- a/ticker.go +++ /dev/null @@ -1,53 +0,0 @@ -package main - -import ( - "time" - - "go.wit.com/log" -) - -var watchtime time.Duration = 100 // in tenths of seconds - -/* - This program sits here. - If you exit here, the whole thing will os.Exit() - TODO: use Ticker - - This goroutine can be used like a watchdog timer -*/ -func Watchdog() { - var i = 1 - for { - log.Verbose("gui.Watchdog() is alive. give me something to do.", i) - i += 1 - time.Sleep(watchtime * time.Second / 10) - } -} -// https://www.reddit.com/r/golang/comments/12em87q/how_to_run_periodic_tasks/ -/* -package main - -import ( - "fmt" - "time" -) - -func main() { - ticker := time.NewTicker(time.Second) - defer ticker.Stop() - done := make(chan bool) - go func() { - time.Sleep(10 * time.Second) - done <- true - }() - for { - select { - case <-done: - fmt.Println("Done!") - return - case t := <-ticker.C: - fmt.Println("Current time: ", t) - } - } -} -*/ |
