mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 10:54:53 +02:00
Retry more on CI when vendor download fails
This commit is contained in:
parent
1d89aa737a
commit
9b5605c9b9
1 changed files with 7 additions and 6 deletions
|
|
@ -28,14 +28,15 @@ def add_options(self, parser):
|
|||
|
||||
def download_vendor_release(self, tdir, url):
|
||||
self.info('Downloading %s:' % self.TAR_NAME, url)
|
||||
try:
|
||||
raw = download_securely(url)
|
||||
except Exception:
|
||||
if not is_ci:
|
||||
raise
|
||||
num = 5 if is_ci else 1
|
||||
for i in range(num):
|
||||
try:
|
||||
raw = download_securely(url)
|
||||
except Exception:
|
||||
if i == num - 1:
|
||||
raise
|
||||
self.info('Download failed, sleeping and retrying...')
|
||||
time.sleep(2)
|
||||
raw = download_securely(url)
|
||||
with tarfile.open(fileobj=BytesIO(raw)) as tf:
|
||||
tf.extractall(tdir)
|
||||
if len(os.listdir(tdir)) == 1:
|
||||
|
|
|
|||
Loading…
Reference in a new issue