Skip to content

Commit fad06f3

Browse files
author
MarcoFalke
committed
test: retry download in get_previous_releases.py
1 parent 1af46cf commit fad06f3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/get_previous_releases.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ def download_binary(tag, args) -> int:
168168
download_from_url(archive_url, archive)
169169
except Exception as e:
170170
print(f"\nDownload failed: {e}", file=sys.stderr)
171-
return 1
171+
print("Retrying download after failure ...", file=sys.stderr)
172+
time.sleep(12)
173+
try:
174+
download_from_url(archive_url, archive)
175+
except Exception as e2:
176+
print(f"\nDownload failed a second time: {e2}", file=sys.stderr)
177+
return 1
172178

173179
hasher = hashlib.sha256()
174180
with open(archive, "rb") as afile:

0 commit comments

Comments
 (0)