From ed3b1e13d8f150c0310b26767a176895a19fb0e1 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Sat, 11 May 2024 10:59:29 +0800 Subject: [PATCH] add etcd --- pkg/common/discoveryregister/etcd/etcd.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/common/discoveryregister/etcd/etcd.go b/pkg/common/discoveryregister/etcd/etcd.go index 9edb48d82..04bd57ca5 100644 --- a/pkg/common/discoveryregister/etcd/etcd.go +++ b/pkg/common/discoveryregister/etcd/etcd.go @@ -92,15 +92,15 @@ func (r *SvcDiscoveryRegistryImpl) Register(serviceName, host string, port int, endpoint := endpoints.Endpoint{Addr: fmt.Sprintf("%s:%d", host, port)} err = em.AddEndpoint(context.TODO(), r.serviceKey, endpoint, clientv3.WithLease(leaseResp.ID)) return err - - lease, _ := r.client.Grant(context.TODO(), 30) - - em, err = endpoints.NewManager(r.client, "foo/bar/my-service") - if err != nil { - return err - } - - err := em.AddEndpoint(context.TODO(), "foo/bar/my-service/e1", endpoints.Endpoint{Addr: "1.2.3.4"}, clientv3.WithLease(lease.ID)) + // + //lease, _ := r.client.Grant(context.TODO(), 30) + // + //em, err = endpoints.NewManager(r.client, "foo/bar/my-service") + //if err != nil { + // return err + //} + // + //err := em.AddEndpoint(context.TODO(), "foo/bar/my-service/e1", endpoints.Endpoint{Addr: "1.2.3.4"}, clientv3.WithLease(lease.ID)) }