Skip to content
Snippets Groups Projects
Commit f1ef207a authored by vito.he's avatar vito.he
Browse files

Mod:rm rather than comment

parent e3783c8e
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
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