mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
add etcd
This commit is contained in:
parent
ed3b1e13d8
commit
a08d0d7218
@ -91,17 +91,12 @@ 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))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, kaErr := r.client.KeepAlive(context.Background(), r.leaseID)
|
||||
return kaErr
|
||||
}
|
||||
|
||||
func (r *SvcDiscoveryRegistryImpl) UnRegister() error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user