Skip to content

Commit f81a9ee

Browse files
committed
fix in 0s timeout
1 parent 28a599f commit f81a9ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎internal/gensupport/resumable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err
269269
status = resp.StatusCode
270270
}
271271

272+
// The upload should be retried if the rCtx is canceled due to a timeout.
272273
select {
273274
case <-rCtx.Done():
274275
if rCtx.Err() == context.DeadlineExceeded {
@@ -278,7 +279,6 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err
278279
}
279280

280281
// Check if we should retry the request.
281-
// The upload should be retried if the rCtx is canceled due to a timeout.
282282
if !errorFunc(status, err) {
283283
quitAfterTimer.Stop()
284284
break

0 commit comments

Comments
 (0)