Skip to content
Snippets Groups Projects
Unverified Commit c6b54e10 authored by Casey's avatar Casey :recycle:
Browse files

helpers: git: retry clone


helps with intermitten DNS errors in CI maybe

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 36a1a30b
No related branches found
No related tags found
No related merge requests found
Pipeline #208991 failed
......@@ -56,7 +56,16 @@ def clone(name_repo: str) -> None:
# Create parent dir and clone
logging.info(f"Clone git repository: {url}")
(get_context().config.work / "cache_git").mkdir(exist_ok=True)
pmb.helpers.run.user(command, output="stdout")
tries = 3
while tries > 0:
try:
pmb.helpers.run.user(command, output="stdout")
break
except RuntimeError as e:
tries -= 1
logging.error(f"Failed to clone repository, trying {tries} more times: {e}")
if tries == 0:
raise
# FETCH_HEAD does not exist after initial clone. Create it, so
# is_outdated() can use it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment