summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-09 04:56:06 -0500
committerJeff Carr <[email protected]>2025-09-09 04:57:06 -0500
commitac5da98149aedb2b315e6ca66403e6b437d59efb (patch)
treee60259ed7d16a4547b2deeb0e94ac0e3ce6f0362
parent60248b5931eb77660c1ef75307ec44099ae14429 (diff)
notsurev0.0.89
-rw-r--r--main.go2
-rw-r--r--watchdog.go18
2 files changed, 7 insertions, 13 deletions
diff --git a/main.go b/main.go
index 1819d77..d219aa1 100644
--- a/main.go
+++ b/main.go
@@ -44,8 +44,6 @@ func main() {
me.pollDelay = 3 * time.Second
me.failcountmax = 20 // die every minute if zookeeper can't be found
- // me.machine.ConfigLoad()
-
me.forge = forgepb.InitPB()
me.machine = zoopb.InitMachine()
diff --git a/watchdog.go b/watchdog.go
index f42e516..66bed5f 100644
--- a/watchdog.go
+++ b/watchdog.go
@@ -20,30 +20,26 @@ func NewWatchdog() {
me.dog = time.NewTicker(me.pollDelay)
defer me.dog.Stop()
done := make(chan bool)
- /*
- // this example would exit/destroy the ticker in 10 seconds
- go func() {
- time.Sleep(10 * time.Second)
- done <- true
- }()
- */
for {
select {
case <-done:
fmt.Println("Done!")
return
case _ = <-me.dog.C:
- // log.Info("Watchdog() ticked", me.zookeeper, "Current time: ", t)
s := me.machine.UpdatePackages()
- // pingStatus()
me.failcount += 1
sendMachine(s)
if me.failcount > 20 {
os.Exit(0)
}
- // h.pollHypervisor()
- // h.Scan()
}
}
+ /*
+ // this example would exit/destroy the ticker in 10 seconds
+ go func() {
+ time.Sleep(10 * time.Second)
+ done <- true
+ }()
+ */
}