|
|
@ -179,7 +179,7 @@ func (r *Resolver) watch(prefix string, addrList []resolver.Address) {
|
|
|
|
|
|
|
|
|
|
|
|
if flag == 1 {
|
|
|
|
if flag == 1 {
|
|
|
|
r.cc.UpdateState(resolver.State{Addresses: addrList})
|
|
|
|
r.cc.UpdateState(resolver.State{Addresses: addrList})
|
|
|
|
//log.Debug("update: ", addrList)
|
|
|
|
log.Debug("update: ", addrList)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -187,7 +187,7 @@ func (r *Resolver) watch(prefix string, addrList []resolver.Address) {
|
|
|
|
func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn {
|
|
|
|
func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn {
|
|
|
|
gEtcdCli, err := clientv3.New(clientv3.Config{Endpoints: strings.Split(etcdaddr, ",")})
|
|
|
|
gEtcdCli, err := clientv3.New(clientv3.Config{Endpoints: strings.Split(etcdaddr, ",")})
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
//log.Error("clientv3.New failed", err.Error())
|
|
|
|
log.Error("clientv3.New failed", err.Error())
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|