From c0c8f5e831c20cb7282473e492bdb2ef882d179d Mon Sep 17 00:00:00 2001 From: bra-fsn Date: Wed, 25 Sep 2024 21:27:04 +0200 Subject: [PATCH] retry --- inspector/lib.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inspector/lib.py b/inspector/lib.py index f5518f9..1eadb29 100644 --- a/inspector/lib.py +++ b/inspector/lib.py @@ -424,7 +424,12 @@ def run_tasks(vendor, data_dir: str | os.PathLike, instance: str, gpu_count: int q.join() # do a push at the end of each round if os.environ.get("GITHUB_TOKEN"): - repo.push_path(data_dir, f"Inspecting server from {repo.gha_url()}") + for i in range(3): + try: + repo.push_path(data_dir, f"Inspecting server from {repo.gha_url()}") + except Exception: + logging.exception("push failed") + time.sleep(random.randint(1, 10)) q.join()