fshttp: don't print token bucket errors on context cancelled

These happen as a natural part of exceeding --max-transfer and we
don't need to worry the user with them.
This commit is contained in:
Nick Craig-Wood
2019-10-30 12:20:10 +00:00
parent 7ff95c6250
commit e6378daadf
+1 -1
View File
@@ -318,7 +318,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
// Get transactions per second token first if limiting
if tpsBucket != nil {
tbErr := tpsBucket.Wait(req.Context())
if tbErr != nil {
if tbErr != nil && tbErr != context.Canceled {
fs.Errorf(nil, "HTTP token bucket error: %v", tbErr)
}
}