Skip to content
Snippets Groups Projects
Commit 114b0c99 authored by 高辛格's avatar 高辛格
Browse files

Merge branch 'develop' into consul

parents bd25bbd0 83b3b9c5
No related branches found
No related tags found
No related merge requests found
......@@ -207,6 +207,20 @@ func (l *ZkEventListener) listenDirEvent(zkPath string, listener remoting.DataLi
for _, c := range children {
// listen l service node
dubboPath := path.Join(zkPath, c)
//Save the path to avoid listen repeatly
l.pathMapLock.Lock()
_, ok := l.pathMap[dubboPath]
l.pathMapLock.Unlock()
if ok {
logger.Warnf("@zkPath %s has already been listened.", zkPath)
continue
}
l.pathMapLock.Lock()
l.pathMap[dubboPath] = struct{}{}
l.pathMapLock.Unlock()
content, _, err := l.client.Conn.Get(dubboPath)
if err != nil {
logger.Errorf("Get new node path {%v} 's content error,message is {%v}", dubboPath, perrors.WithStack(err))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment