Skip to content
Snippets Groups Projects
Commit cf524d40 authored by pantianying's avatar pantianying
Browse files

add add deal res.Action in refreshInvokers

parent 8a41f127
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ import (
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/protocolwrapper"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting"
)
const (
......@@ -124,18 +125,18 @@ func (dir *registryDirectory) refreshInvokers(res *registry.ServiceEvent) {
//TODO: router
}
}
//
//switch res.Action {
//case remoting.EventTypeAdd:
// //dir.cacheService.EventTypeAdd(res.Path, dir.serviceTTL)
// dir.cacheInvoker(&res.Service)
//case remoting.EventTypeDel:
// //dir.cacheService.EventTypeDel(res.Path, dir.serviceTTL)
// dir.uncacheInvoker(&res.Service)
// logger.Infof("selector delete service url{%s}", res.Service)
//default:
// return
//}
switch res.Action {
case remoting.EventTypeAdd, remoting.EventTypeUpdate:
//dir.cacheService.EventTypeAdd(res.Path, dir.serviceTTL)
dir.cacheInvoker(&res.Service)
case remoting.EventTypeDel:
//dir.cacheService.EventTypeDel(res.Path, dir.serviceTTL)
dir.uncacheInvoker(&res.Service)
logger.Infof("selector delete service url{%s}", res.Service)
default:
return
}
dir.cacheInvoker(url)
newInvokers := dir.toGroupInvokers()
dir.listenerLock.Lock()
......
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