@actions/cache
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -29,2 +29,3 @@ "use strict"; | ||
const requestUtils_1 = require("./requestUtils"); | ||
const abort_controller_1 = require("@azure/abort-controller"); | ||
/** | ||
@@ -213,2 +214,6 @@ * Pipes the body of a HTTP response to a stream | ||
downloadProgress.startDisplayTimer(); | ||
const abortSignal = abort_controller_1.AbortController.timeout(options.segmentTimeoutInMs || 3600000); | ||
abortSignal.addEventListener('abort', () => { | ||
core.warning('Aborting cache download as it exceeded the timeout.'); | ||
}); | ||
while (!downloadProgress.isDone()) { | ||
@@ -219,2 +224,3 @@ const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize; | ||
const result = yield client.downloadToBuffer(segmentStart, segmentSize, { | ||
abortSignal, | ||
concurrency: options.downloadConcurrency, | ||
@@ -221,0 +227,0 @@ onProgress: downloadProgress.onProgress() |
@@ -44,2 +44,8 @@ /** | ||
timeoutInMs?: number; | ||
/** | ||
* Time after which a segment download should be aborted if stuck | ||
* | ||
* @default 3600000 | ||
*/ | ||
segmentTimeoutInMs?: number; | ||
} | ||
@@ -46,0 +52,0 @@ /** |
@@ -43,3 +43,4 @@ "use strict"; | ||
downloadConcurrency: 8, | ||
timeoutInMs: 30000 | ||
timeoutInMs: 30000, | ||
segmentTimeoutInMs: 3600000 | ||
}; | ||
@@ -56,2 +57,5 @@ if (copy) { | ||
} | ||
if (typeof copy.segmentTimeoutInMs === 'number') { | ||
result.segmentTimeoutInMs = copy.segmentTimeoutInMs; | ||
} | ||
} | ||
@@ -61,2 +65,3 @@ core.debug(`Use Azure SDK: ${result.useAzureSdk}`); | ||
core.debug(`Request timeout (ms): ${result.timeoutInMs}`); | ||
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); | ||
return result; | ||
@@ -63,0 +68,0 @@ } |
{ | ||
"name": "@actions/cache", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"preview": true, | ||
@@ -5,0 +5,0 @@ "description": "Actions cache lib", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96790
1423