1
0
Fork 0

Fix bug downloading large files with the Azure SDK

pull/528/head
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

@ -14,4 +14,7 @@
- Downloads Azure-hosted caches using the Azure SDK for speed and reliability - Downloads Azure-hosted caches using the Azure SDK for speed and reliability
- Displays download progress - Displays download progress
- Includes changes that break compatibility with earlier versions, including: - Includes changes that break compatibility with earlier versions, including:
- `retry`, `retryTypedResponse`, and `retryHttpClientResponse` moved from `cacheHttpClient` to `requestUtils` - `retry`, `retryTypedResponse`, and `retryHttpClientResponse` moved from `cacheHttpClient` to `requestUtils`
### 1.0.1
- Fix bug in downloading large files (> 2 GBs) with the Azure SDK

27
packages/cache/package-lock.json generated vendored
View File

@ -216,28 +216,6 @@
"form-data": "^3.0.0" "form-data": "^3.0.0"
} }
}, },
"@types/prop-types": {
"version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
},
"@types/react": {
"version": "16.9.38",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.38.tgz",
"integrity": "sha512-pHAeZbjjNRa/hxyNuLrvbxhhnKyKNiLC6I5fRF2Zr/t/S6zS41MiyzH4+c+1I9vVfvuRt1VS2Lodjr4ZWnxrdA==",
"requires": {
"@types/prop-types": "*",
"csstype": "^2.2.0"
}
},
"@types/react-native": {
"version": "0.62.13",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.62.13.tgz",
"integrity": "sha512-hs4/tSABhcJx+J8pZhVoXHrOQD89WFmbs8QiDLNSA9zNrD46pityAuBWuwk1aMjPk9I3vC5ewkJroVRHgRIfdg==",
"requires": {
"@types/react": "*"
}
},
"@types/semver": { "@types/semver": {
"version": "6.2.1", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.1.tgz", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.1.tgz",
@ -298,11 +276,6 @@
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
}, },
"csstype": {
"version": "2.6.10",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.10.tgz",
"integrity": "sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w=="
},
"delayed-stream": { "delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "@actions/cache", "name": "@actions/cache",
"version": "1.0.0", "version": "1.0.1",
"preview": true, "preview": true,
"description": "Actions cache lib", "description": "Actions cache lib",
"keywords": [ "keywords": [

View File

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