Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added retries to the location service api for download packages - upack #14649

Merged
merged 3 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tasks/DownloadPackageV1/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function main(): Promise<void> {
}

if (packageType === "upack") {
return await downloadUniversalPackage(downloadPath, feed.projectId, feed.feedId, packageId, version, filesPattern);
return await downloadUniversalPackage(downloadPath, feed.projectId, feed.feedId, packageId, version, filesPattern, Retry(retryLimit));
}

let files: string[] = [];
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DownloadPackageV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "ms-vscs-rm",
"version": {
"Major": 1,
"Minor": 184,
"Minor": 185,
"Patch": 0
},
"demands": [],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DownloadPackageV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "ms-vscs-rm",
"version": {
"Major": 1,
"Minor": 184,
"Minor": 185,
"Patch": 0
},
"demands": [],
Expand Down
7 changes: 4 additions & 3 deletions Tasks/DownloadPackageV1/universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export async function downloadUniversalPackage(
feedId: string,
packageId: string,
version: string,
filterPattern: string
filterPattern: string,
executeWithRetries: <T>(operation: () => Promise<T>) => Promise<T>
): Promise<void> {
try {
const accessToken = pkgLocationUtils.getSystemAccessToken();
let serviceUri = tl.getEndpointUrl("SYSTEMVSSCONNECTION", false);
const blobUri = await pkgLocationUtils.getBlobstoreUriFromBaseServiceUri(serviceUri, accessToken);
const blobUri = await executeWithRetries(() => pkgLocationUtils.getBlobstoreUriFromBaseServiceUri(serviceUri, accessToken));

// Finding the artifact tool directory
var artifactToolPath = await artifactToolUtilities.getArtifactToolFromService(
Expand All @@ -25,7 +26,7 @@ export async function downloadUniversalPackage(
"artifacttool"
);

const feedUri = await pkgLocationUtils.getFeedUriFromBaseServiceUri(serviceUri, accessToken);
const feedUri = await executeWithRetries(() => pkgLocationUtils.getFeedUriFromBaseServiceUri(serviceUri, accessToken));
let packageName: string = await artifactToolUtilities.getPackageNameFromId(
feedUri,
accessToken,
Expand Down