Commit e9bda41b authored by Jérome Perrin's avatar Jérome Perrin

theia retry downloads

parent 1a332998
...@@ -100,7 +100,17 @@ for plugin_and_version in '''\ ...@@ -100,7 +100,17 @@ for plugin_and_version in '''\
api_url = f'https://open-vsx.org/api/{publisher}/{extension_name}/{version}' api_url = f'https://open-vsx.org/api/{publisher}/{extension_name}/{version}'
logger.info(plugin_and_version) logger.info(plugin_and_version)
retries = 3
while retries:
try:
download_url = session.get(api_url, timeout=timeout).json()['files']['download'] download_url = session.get(api_url, timeout=timeout).json()['files']['download']
except Exception:
retries = retries - 1
if not retries:
raise
else:
break
md5sum = hashlib.md5(session.get(download_url, timeout=timeout).content).hexdigest() md5sum = hashlib.md5(session.get(download_url, timeout=timeout).content).hexdigest()
urls.append(f'{publisher}-{extension_name} {download_url} {md5sum}') urls.append(f'{publisher}-{extension_name} {download_url} {md5sum}')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment