mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Retry more on CI when vendor download fails
This commit is contained in:
parent
1d89aa737a
commit
9b5605c9b9
@ -28,14 +28,15 @@ class ReVendor(Command):
|
||||
|
||||
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…
x
Reference in New Issue
Block a user