mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Retry vendored dependency download failures on CI
GitHub Actions is getting insanely flaky
This commit is contained in:
parent
bc8d76cfef
commit
8eca4d7ced
@ -2,13 +2,16 @@
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2019, Eli Schwartz <eschwartz@archlinux.org>
|
||||
|
||||
import os, shutil
|
||||
from io import BytesIO
|
||||
import os
|
||||
import shutil
|
||||
import tarfile
|
||||
|
||||
import time
|
||||
from io import BytesIO
|
||||
|
||||
from setup import Command, download_securely
|
||||
|
||||
is_ci = os.environ.get('CI', '').lower() == 'true'
|
||||
|
||||
|
||||
class ReVendor(Command):
|
||||
|
||||
@ -25,6 +28,13 @@ 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
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user