Fix bug downloading large files with the Azure SDK

This commit is contained in:
Dave Hadka
2020-07-20 15:19:26 -05:00
parent 1cc56db0ff
commit 781092b1d1
4 changed files with 10 additions and 31 deletions

View File

@@ -249,15 +249,18 @@ export async function downloadCacheStorageSDK(
downloadProgress.startDisplayTimer()
while (!downloadProgress.isDone()) {
const segmentStart =
downloadProgress.segmentOffset + downloadProgress.segmentSize
const segmentSize = Math.min(
maxSegmentSize,
contentLength - downloadProgress.segmentOffset
contentLength - segmentStart
)
downloadProgress.nextSegment(segmentSize)
const result = await client.downloadToBuffer(
downloadProgress.segmentOffset,
segmentStart,
segmentSize,
{
concurrency: options.downloadConcurrency,