You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/26 09:09:38 UTC

[GitHub] [arrow] kou commented on a diff in pull request #12996: ARROW-14651: [Release][Archery] Add support for retrying download

kou commented on code in PR #12996:
URL: https://github.com/apache/arrow/pull/12996#discussion_r858475603


##########
dev/archery/archery/crossbow/cli.py:
##########
@@ -339,7 +340,24 @@ def asset_callback(task_name, task, asset):
             path = target_dir / task_name / asset.name
             path.parent.mkdir(exist_ok=True)
             if not dry_run:
-                asset.download(path)
+                import github3
+                max_n_retries = 5
+                n_retries = 0
+                while True:
+                    try:
+                        asset.download(path)
+                    except github3.exceptions.GitHubException as error:
+                        n_retries += 1
+                        if n_retries == max_n_retries:

Review Comment:
   If we use a for loop, no exception is raised when all retries are failed.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org