mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-18 03:08:04 +08:00
Fix bug downloading large files with the Azure SDK
This commit is contained in:
7
packages/cache/src/internal/downloadUtils.ts
vendored
7
packages/cache/src/internal/downloadUtils.ts
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user