pull/455/head
wenxu12345 3 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 82511322a2
commit 41d94e2f40

@ -44,12 +44,16 @@ func NewResolver(schema, etcdAddr, serviceName string) (*Resolver, error) {
r.etcdAddr = etcdAddr r.etcdAddr = etcdAddr
resolver.Register(&r) resolver.Register(&r)
conn, err := grpc.Dial( ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
GetPrefix(schema, serviceName), conn, err := grpc.DialContext(ctx, GetPrefix(schema, serviceName),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)),
grpc.WithInsecure(), grpc.WithInsecure())
grpc.WithTimeout(time.Duration(5)*time.Second), //conn, err := grpc.Dial(
) // GetPrefix(schema, serviceName),
// grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)),
// grpc.WithInsecure(),
// grpc.WithTimeout(time.Duration(5)*time.Second),
//)
if err == nil { if err == nil {
r.grpcClientConn = conn r.grpcClientConn = conn
} }

Loading…
Cancel
Save