mirror of https://github.com/actions/toolkit
Merge pull request #528 from dhadka/dhadka/fix-download-calc
Fix bug downloading large files with the Azure SDKpull/530/head
commit
cb18a3df6b
|
@ -15,3 +15,6 @@
|
||||||
- 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
|
|
@ -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",
|
||||||
|
|
|
@ -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": [
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue