From d61a6fbeebb7b8154a0edec1a35a863daa0973a7 Mon Sep 17 00:00:00 2001 From: Omesh Date: Tue, 25 Jun 2019 12:32:13 +0530 Subject: [PATCH] Add retires while getting build API. (#10714) (#10743) --- Tasks/DownloadBuildArtifactsV0/main.ts | 5 ++++- Tasks/DownloadBuildArtifactsV0/task.json | 2 +- Tasks/DownloadBuildArtifactsV0/task.loc.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tasks/DownloadBuildArtifactsV0/main.ts b/Tasks/DownloadBuildArtifactsV0/main.ts index 75d8defa37ee..a117a6ac30b3 100644 --- a/Tasks/DownloadBuildArtifactsV0/main.ts +++ b/Tasks/DownloadBuildArtifactsV0/main.ts @@ -87,7 +87,10 @@ async function main(): Promise { var retryLimit = parseInt(tl.getVariable("VSTS_HTTP_RETRY")) ? parseInt(tl.getVariable("VSTS_HTTP_RETRY")) : 4; var templatePath: string = path.join(__dirname, 'vsts.handlebars.txt'); - var buildApi: IBuildApi = await webApi.getBuildApi(); + var buildApi: IBuildApi = await executeWithRetries("getBuildApi", () => webApi.getBuildApi(), retryLimit).catch((reason) => { + reject(reason); + return; + }); var artifacts = []; if (isCurrentBuild) { diff --git a/Tasks/DownloadBuildArtifactsV0/task.json b/Tasks/DownloadBuildArtifactsV0/task.json index cfe4fcb4da81..a09cd61223f8 100644 --- a/Tasks/DownloadBuildArtifactsV0/task.json +++ b/Tasks/DownloadBuildArtifactsV0/task.json @@ -9,7 +9,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 154, + "Minor": 155, "Patch": 0 }, "groups": [ diff --git a/Tasks/DownloadBuildArtifactsV0/task.loc.json b/Tasks/DownloadBuildArtifactsV0/task.loc.json index 78d3c9c06cef..98793f886560 100644 --- a/Tasks/DownloadBuildArtifactsV0/task.loc.json +++ b/Tasks/DownloadBuildArtifactsV0/task.loc.json @@ -9,7 +9,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 154, + "Minor": 155, "Patch": 0 }, "groups": [