From 81cc09aa61dcfdb79256768c445e46e83f9897c2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Jan 2023 07:11:52 +0530 Subject: [PATCH] Increase number of retries when uploading to github as it is getting flakier than ever --- publish.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/publish.py b/publish.py index 37604ce05..078ed14f2 100755 --- a/publish.py +++ b/publish.py @@ -294,7 +294,7 @@ class GitHub(Base): # {{{ time.sleep(1) self.fail(r, f'Failed to delete {fname} from GitHub') - def upload_with_retries(path: str, desc: str, num_tries: int = 4, sleep_time: float = 10.0) -> None: + def upload_with_retries(path: str, desc: str, num_tries: int = 8, sleep_time: float = 60.0) -> None: fname = os.path.basename(path) if self.is_nightly: fname = fname.replace(version, 'nightly') @@ -305,12 +305,10 @@ class GitHub(Base): # {{{ for i in range(1, num_tries+1): try: r = self.do_upload(upload_url, path, desc, fname) - except Exception: + except Exception as e: if i >= num_tries: raise - import traceback - traceback.print_exc() - print('Failed to upload retrying in a short while...', file=sys.stderr) + print('Failed to upload with error:', e, 'retrying in a short while...', file=sys.stderr) else: if r.status_code == 201: break