{“id”:“go.micro.client”,“code”:408,“detail”:“call timeout: context deadline exceeded”,“status”:“Request Timeout”}
这是因为micro web客户端超时,设置超时时间
var opts client.CallOption = func(o *client.CallOptions) {
o.RequestTimeout = time.Second * 30
o.DialTimeout = time.Second * 30
}
将opts在call方法中添加:
rep, err := microClient.Call(context.TODO(), &go_micro_service_helloworld.Request{Name:“Brad”},
opts)