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):
|
def download_vendor_release(self, tdir, url):
|
||||||
self.info('Downloading %s:' % self.TAR_NAME, url)
|
self.info('Downloading %s:' % self.TAR_NAME, url)
|
||||||
try:
|
num = 5 if is_ci else 1
|
||||||
raw = download_securely(url)
|
for i in range(num):
|
||||||
except Exception:
|
try:
|
||||||
if not is_ci:
|
raw = download_securely(url)
|
||||||
raise
|
except Exception:
|
||||||
|
if i == num - 1:
|
||||||
|
raise
|
||||||
self.info('Download failed, sleeping and retrying...')
|
self.info('Download failed, sleeping and retrying...')
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
raw = download_securely(url)
|
|
||||||
with tarfile.open(fileobj=BytesIO(raw)) as tf:
|
with tarfile.open(fileobj=BytesIO(raw)) as tf:
|
||||||
tf.extractall(tdir)
|
tf.extractall(tdir)
|
||||||
if len(os.listdir(tdir)) == 1:
|
if len(os.listdir(tdir)) == 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user