Closed Ebsan closed 1 year ago
This pull will cause issues for #24 because only one version of the latest non-prerelease extension will be downloaded. Logic needs to be added to download all the targetTypes of the latest version. Use redhat.java
as a good example.
POST
{
"filters": [
{
"criteria": [
{
"filterType": 10,
"value": "redhat.java"
},
{
"filterType": 8,
"value": "Microsoft.VisualStudio.Code"
},
{
"filterType": 12,
"value": "4096"
}
],
"pageNumber": 1,
"pageSize": 50,
"sortBy": 0,
"sortOrder": 0
}
],
"assetTypes": [],
"flags": 950
}
Hi,
I advise to test the removal of the requests sessions, this should increase performence. however, when requests fails we can use some retry mechanisem, for instance:
from requests.adapters import HTTPAdapter, Retry
retries = Retry(total=5, backoff_factor=1, status_forcelist=[ 413, 429, 500, 501, 502, 503, 504, ], allowed_methods=["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"])
session = requests.session()
session.mount('https://', HTTPAdapter(max_retries=retries))
# session.get(...)
@tomer953 I will test your recommendation in another pull request. I can probably run some timed tests for the different requests solutions as well in that pull request.
Takes care of #31 and downloads only non-prerelease versions of extensions.
Some other updates are:
session = requests.session()
in favor of using the the http method directly from therequests
object. This was an attempt to fix #33.--prerelease-extensions
toggle to allow user to download prerelease extensions as well--vscode-version
arg to configure version used in User-Agent header. Defaults to 1.69.2, the latest version of VSCode as of today