diff options
| -rw-r--r-- | main.go | 2 | ||||
| -rw-r--r-- | watchdog.go | 18 |
2 files changed, 7 insertions, 13 deletions
@@ -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 + }() + */ } |
