From 0fed297615a2b6d761ea7825568a93a24e5ea26b Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Mon, 13 May 2024 17:44:40 +0800 Subject: [PATCH] Add etcd as a service discovery mechanism --- pkg/common/discoveryregister/etcd/etcd.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/common/discoveryregister/etcd/etcd.go b/pkg/common/discoveryregister/etcd/etcd.go index 7c2bcff66..4ce60dbd5 100644 --- a/pkg/common/discoveryregister/etcd/etcd.go +++ b/pkg/common/discoveryregister/etcd/etcd.go @@ -193,8 +193,7 @@ func (r *SvcDiscoveryRegistryImpl) refreshConnMap(prefix string) { fmt.Printf("Failed to get endpoints: %v\n", err) return } - - // Update the connMap with new connections + r.connMap[prefix] = []*grpc.ClientConn{} // Update the connMap with new connections for _, kv := range resp.Kvs { _, addr := r.splitEndpoint(string(kv.Key)) conn, err := grpc.DialContext(context.Background(), addr, append(r.dialOptions, grpc.WithResolvers(r.resolver))...)