Skip to content

Commit

Permalink
Hardcode retry iteration 1 to DownloadFromResultsContainer (#7723)
Browse files Browse the repository at this point in the history
  • Loading branch information
safern authored Aug 6, 2021
1 parent 45be86f commit dc542a6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ private async Task DownloadFilesForWorkItem(ITaskItem workItem, string directory
string destinationFile = Path.Combine(destinationDir.FullName, file);
Log.LogMessage(MessageImportance.Normal, $"Downloading {file} => {destinationFile}...");

var uri = new Uri($"{ResultsContainer}{workItemName}/{file}");
// Currently the blob storage includes the retry iteration, however there is no good way
// to get the "best" iteration number to download the files from. For now, use always iteration
// 1 until helix provides an API to get result files from the "good" iteration run.
// https://github.com/dotnet/core-eng/issues/13983
var uri = new Uri($"{ResultsContainer}{workItemName}/1/{file}");
CloudBlob blob = string.IsNullOrEmpty(ResultsContainerReadSAS) ? new CloudBlob(uri) : new CloudBlob(uri, new StorageCredentials(ResultsContainerReadSAS));
await blob.DownloadToFileAsync(destinationFile, FileMode.Create);
}
catch (StorageException e)
{
Log.LogWarning($"Failed to download {workItemName}/{file} blob from results container: {e.Message}");
Log.LogWarning($"Failed to download {workItemName}/1/{file} blob from results container: {e.Message}");
}
}
};
Expand Down

0 comments on commit dc542a6

Please sign in to comment.