From 0d5e4471573cc747c13c6a255ab2d61dc2512e1d Mon Sep 17 00:00:00 2001 From: "vito.he" <hxmhlt@163.com> Date: Wed, 29 Jan 2020 12:04:50 +0800 Subject: [PATCH] Mod:rm rather than comment --- remoting/zookeeper/listener.go | 45 ---------------------------------- 1 file changed, 45 deletions(-) diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index ece81eb22..6850aa3ff 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -280,51 +280,6 @@ func timeSecondDuration(sec int) time.Duration { // | // --------> ListenServiceNodeEvent func (l *ZkEventListener) ListenServiceEvent(zkPath string, listener remoting.DataListener) { - //var ( - // err error - // dubboPath string - // children []string - //) - // - //zkPath = strings.ReplaceAll(zkPath, "$", "%24") - //l.pathMapLock.Lock() - //_, ok := l.pathMap[zkPath] - //l.pathMapLock.Unlock() - //if ok { - // logger.Warnf("@zkPath %s has already been listened.", zkPath) - // return - //} - // - //l.pathMapLock.Lock() - //l.pathMap[zkPath] = struct{}{} - //l.pathMapLock.Unlock() - // - //logger.Infof("listen dubbo provider path{%s} event and wait to get all provider zk nodes", zkPath) - //children, err = l.client.GetChildren(zkPath) - //if err != nil { - // children = nil - // logger.Warnf("fail to get children of zk path{%s}", zkPath) - //} - // - //for _, c := range children { - // // listen l service node - // dubboPath = path.Join(zkPath, c) - // 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)) - // } - // if !listener.DataChange(remoting.Event{Path: dubboPath, Action: remoting.EventTypeAdd, Content: string(content)}) { - // continue - // } - // logger.Infof("listen dubbo service key{%s}", dubboPath) - // go func(zkPath string, listener remoting.DataListener) { - // if l.ListenServiceNodeEvent(zkPath) { - // listener.DataChange(remoting.Event{Path: zkPath, Action: remoting.EventTypeDel}) - // } - // logger.Warnf("listenSelf(zk path{%s}) goroutine exit now", zkPath) - // }(dubboPath, listener) - //} - logger.Infof("listen dubbo path{%s}", zkPath) go func(zkPath string, listener remoting.DataListener) { l.listenDirEvent(zkPath, listener) -- GitLab