test discov

test-errcode
wangchuxiao 1 year ago
parent 2aa7ed27e1
commit 80c46919dd

@ -6,6 +6,7 @@ import (
"strings"
"sync"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/pkg/errors"
"github.com/go-zookeeper/zk"
@ -24,6 +25,7 @@ func (s *ZkClient) watch(wg *sync.WaitGroup) {
case zk.EventSession:
case zk.EventNodeCreated:
case zk.EventNodeChildrenChanged:
log.ZDebug(context.Background(), "zk event", "event", event.Path)
l := strings.Split(event.Path, "/")
s.lock.Lock()
if len(l) > 1 {

@ -25,7 +25,7 @@ func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions) {
}
r.addrs = newConns
log.ZDebug(context.Background(), "resolve now finished", "target", r.target, "conns", r.addrs)
r.cc.UpdateState(resolver.State{Addresses: r.addrs})
r.cc.UpdateState(resolver.State{Addresses: newConns})
}
func (s *Resolver) Close() {}

Loading…
Cancel
Save