diff --git a/store/store.go b/store/store.go
index ecccf8f26..e71c46c6f 100644
--- a/store/store.go
+++ b/store/store.go
@@ -1390,12 +1390,19 @@ var download = func(ctx context.Context, name, sha3_384, downloadURL string, use
}
if finalErr != nil {
if shouldRetryError(attempt, finalErr) {
+ pos, err := w.Seek(0, os.SEEK_CUR)
+ if err != nil {
+ return fmt.Errorf("cannot find current position inside downloaded file: %s", err)
+ }
+ resume = pos
+ logger.Debugf("Retrying because of: %s", finalErr)
continue
}
break
}
if shouldRetryHttpResponse(attempt, resp) {
+ logger.Debugf("Retrying because of: %s", resp)
resp.Body.Close()
continue
}