Ubuntu Pastebin

Paste from egon at Mon, 10 Apr 2017 08:35:43 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
 		}
Download as text