Skip to content

Commit

Permalink
Merge pull request QubitProducts#9 from QubitProducts/zk-errors
Browse files Browse the repository at this point in the history
Improve ZK error logging when nodes don’t exist
  • Loading branch information
Jing Dong committed Sep 5, 2014
2 parents dcef644 + b61dd2f commit 30eaf17
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions qzk/qzk.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ func ListenToZooKeeper(config c.Zookeeper, deb bool) (chan zk.Event, chan bool)

func ListenToConn(c *zk.Conn, path string, deb bool, repDelay time.Duration) (chan zk.Event, chan bool) {

exists, _, err := c.Exists(path)

if err != nil {
logger.Fatalf("Couldn't determine whether node %v exists in Zookeeper", path)
}
if !exists {
logger.Fatalf("Couldn't find node %v in Zookeeper", path)
}

quit := make(chan bool)
evts := make(chan zk.Event)

Expand All @@ -149,3 +158,8 @@ func ListenToConn(c *zk.Conn, path string, deb bool, repDelay time.Duration) (ch
}
return evts, quit
}

func nodeExists(c *zk.Conn, path string) bool {

return false
}

0 comments on commit 30eaf17

Please sign in to comment.