SanyamSuyal commented on code in PR #2733:
URL: https://github.com/apache/fory/pull/2733#discussion_r2417538432
##########
ci/tasks/common.py:
##########
@@ -88,6 +87,34 @@ def get_bazel_download_url():
return
f"{download_url_base}/bazel-{bazel_version}-{get_os_name_lower()}-{get_os_machine()}"
+def urlretrieve_with_retries(url, filename, max_attempts=5, initial_delay=2):
+ """Download a URL to filename with retries and exponential backoff.
+
+ Raises the last exception if all attempts fail.
+ """
+ attempt = 1
+ delay = initial_delay
+ last_exc = None
+ while attempt <= max_attempts:
+ try:
+ logging.info(f"Downloading (attempt {attempt}) {url} ->
{filename}")
+ ulib.urlretrieve(url, filename)
Review Comment:
> ditto
Yes, it overwrites directly. The curl -o flag and urlretrieve will replace
the target file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]