没解决
This commit is contained in:
parent
2a0bcdfd5d
commit
8f305a2c85
|
|
@ -13,7 +13,7 @@ import (
|
|||
func main() {
|
||||
consul.FindServer()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
conn, err := grpc.DialContext(ctx, "consul://192.168.8.254:8500/demo", grpc.WithBlock(), grpc.WithInsecure())
|
||||
conn, err := grpc.DialContext(ctx, "consul://192.168.8.254:8500/demo", grpc.WithBlock(), grpc.WithInsecure(), grpc.WithBalancerName("round_robin"))
|
||||
if err != nil {
|
||||
cancel()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue