1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

modify discovery

This commit is contained in:
wuxingzhong 2020-01-07 16:38:25 +08:00
parent a1839c0d68
commit 821da8a54f

View File

@ -601,7 +601,9 @@ func (d *Discovery) polls(ctx context.Context) (apps map[string]*naming.Instance
}
if err = d.httpClient.Get(ctx, uri, "", params, res); err != nil {
d.switchNode()
log.Error("discovery: client.Get(%s) error(%+v)", uri+"?"+params.Encode(), err)
if ctx.Err() != context.Canceled {
log.Error("discovery: client.Get(%s) error(%+v)", uri+"?"+params.Encode(), err)
}
return
}
if ec := ecode.Int(res.Code); !ecode.Equal(ecode.OK, ec) {