Skip to content

Commit 86ee179

Browse files
committed
Bug 1886737 - fetch-content: fix download_to_memory retries. r=releng-reviewers,bhearsum DONTBUILD
Previously we would append data from each download to the previous, failed one(s). Differential Revision: https://phabricator.services.mozilla.com/D205315
1 parent 71d1e85 commit 86ee179

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/taskgraph/run-task/fetch-content

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ def download_to_path(url, path, sha256=None, size=None, headers=None):
284284
def download_to_memory(url, sha256=None, size=None):
285285
"""Download a URL to memory, possibly with verification."""
286286

287-
data = b""
288287
for _ in retrier(attempts=5, sleeptime=60):
289-
try:
290-
log("Downloading %s" % (url))
288+
data = b""
289+
log("Downloading %s" % (url))
291290

291+
try:
292292
for chunk in stream_download(url, sha256=sha256, size=size):
293293
data += chunk
294294

0 commit comments

Comments
 (0)