Skip to content

Commit cb18a3d

Browse files
authored
Merge pull request #528 from dhadka/dhadka/fix-download-calc
Fix bug downloading large files with the Azure SDK
2 parents 1cc56db + 781092b commit cb18a3d

4 files changed

Lines changed: 10 additions & 31 deletions

File tree

packages/cache/RELEASES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@
1414
- Downloads Azure-hosted caches using the Azure SDK for speed and reliability
1515
- Displays download progress
1616
- Includes changes that break compatibility with earlier versions, including:
17-
- `retry`, `retryTypedResponse`, and `retryHttpClientResponse` moved from `cacheHttpClient` to `requestUtils`
17+
- `retry`, `retryTypedResponse`, and `retryHttpClientResponse` moved from `cacheHttpClient` to `requestUtils`
18+
19+
### 1.0.1
20+
- Fix bug in downloading large files (> 2 GBs) with the Azure SDK

packages/cache/package-lock.json

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cache/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@actions/cache",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"preview": true,
55
"description": "Actions cache lib",
66
"keywords": [

packages/cache/src/internal/downloadUtils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,18 @@ export async function downloadCacheStorageSDK(
249249
downloadProgress.startDisplayTimer()
250250

251251
while (!downloadProgress.isDone()) {
252+
const segmentStart =
253+
downloadProgress.segmentOffset + downloadProgress.segmentSize
254+
252255
const segmentSize = Math.min(
253256
maxSegmentSize,
254-
contentLength - downloadProgress.segmentOffset
257+
contentLength - segmentStart
255258
)
256259

257260
downloadProgress.nextSegment(segmentSize)
258261

259262
const result = await client.downloadToBuffer(
260-
downloadProgress.segmentOffset,
263+
segmentStart,
261264
segmentSize,
262265
{
263266
concurrency: options.downloadConcurrency,

0 commit comments

Comments
 (0)