From c28579f6d0f05814e5283fd32b84ea7d8380f358 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Sat, 11 May 2024 09:50:11 +0800 Subject: [PATCH] add etcd --- pkg/common/discoveryregister/etcd/etcd.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/common/discoveryregister/etcd/etcd.go b/pkg/common/discoveryregister/etcd/etcd.go index ce76fae15..db27ebf8f 100644 --- a/pkg/common/discoveryregister/etcd/etcd.go +++ b/pkg/common/discoveryregister/etcd/etcd.go @@ -83,7 +83,7 @@ func (r *SvcDiscoveryRegistryImpl) Register(serviceName, host string, port int, } r.endpointMgr = em - leaseResp, err := r.client.Grant(context.Background(), 5) + leaseResp, err := r.client.Grant(context.Background(), 30) if err != nil { return err } @@ -91,11 +91,6 @@ 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)) - if err != nil { - return err - } - - _, err = r.client.KeepAlive(context.Background(), r.leaseID) return err }