mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix unneccessary re-downloads when re-vendoring
This commit is contained in:
parent
d148e2da5f
commit
1967b3e95d
@ -32,11 +32,11 @@ class ReVendor(Command):
|
|||||||
for i in range(num):
|
for i in range(num):
|
||||||
try:
|
try:
|
||||||
raw = download_securely(url)
|
raw = download_securely(url)
|
||||||
except Exception:
|
except Exception as err:
|
||||||
if i == num - 1:
|
if i == num - 1:
|
||||||
raise
|
raise
|
||||||
self.info('Download failed, sleeping and retrying...')
|
self.info(f'Download failed with error "{err}" sleeping and retrying...')
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
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