mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Add etcd as a service discovery mechanism
This commit is contained in:
parent
4d300e9abe
commit
ac7e074d61
@ -94,6 +94,7 @@ func (r *SvcDiscoveryRegistryImpl) GetConns(ctx context.Context, serviceName str
|
||||
// List all endpoints for the service
|
||||
resp, err := r.client.Get(ctx, fullServiceKey, clientv3.WithPrefix())
|
||||
if err != nil {
|
||||
fmt.Println("GetConns get ", fullServiceKey, err.Error())
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -102,6 +103,7 @@ func (r *SvcDiscoveryRegistryImpl) GetConns(ctx context.Context, serviceName str
|
||||
target := fmt.Sprintf("etcd://%s", endpoint)
|
||||
conn, err := grpc.DialContext(ctx, target, append(append(r.dialOptions, opts...), grpc.WithResolvers(r.resolver))...)
|
||||
if err != nil {
|
||||
fmt.Println("DialContext ", target, err.Error())
|
||||
return nil, err
|
||||
}
|
||||
conns = append(conns, conn)
|
||||
|
Loading…
x
Reference in New Issue
Block a user