fix the zookeper race (#4355)
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
9fe8bcf4be
commit
a155b6d29d
|
@ -137,8 +137,11 @@ func NewDiscovery(
|
|||
logger = log.NewNopLogger()
|
||||
}
|
||||
|
||||
conn, _, err := zk.Connect(srvs, timeout)
|
||||
conn.SetLogger(treecache.NewZookeeperLogger(logger))
|
||||
conn, _, err := zk.Connect(
|
||||
srvs, timeout,
|
||||
func(c *zk.Conn) {
|
||||
c.SetLogger(treecache.NewZookeeperLogger(logger))
|
||||
})
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue