Skip to content

Commit

Permalink
Updated actions/cache version to 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sankalp Kotewar committed Aug 9, 2022
1 parent f427802 commit a404368
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .licenses/npm/@actions/cache.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5473,6 +5473,7 @@ const util = __importStar(__webpack_require__(669));
const utils = __importStar(__webpack_require__(15));
const constants_1 = __webpack_require__(931);
const requestUtils_1 = __webpack_require__(899);
const abort_controller_1 = __webpack_require__(106);
/**
* Pipes the body of a HTTP response to a stream
*
Expand Down Expand Up @@ -5656,11 +5657,16 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
const fd = fs.openSync(archivePath, 'w');
try {
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()) {
const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize;
const segmentSize = Math.min(maxSegmentSize, contentLength - segmentStart);
downloadProgress.nextSegment(segmentSize);
const result = yield client.downloadToBuffer(segmentStart, segmentSize, {
abortSignal,
concurrency: options.downloadConcurrency,
onProgress: downloadProgress.onProgress()
});
Expand Down Expand Up @@ -40795,7 +40801,8 @@ function getDownloadOptions(copy) {
const result = {
useAzureSdk: true,
downloadConcurrency: 8,
timeoutInMs: 30000
timeoutInMs: 30000,
segmentTimeoutInMs: 3600000
};
if (copy) {
if (typeof copy.useAzureSdk === 'boolean') {
Expand All @@ -40807,10 +40814,14 @@ function getDownloadOptions(copy) {
if (typeof copy.timeoutInMs === 'number') {
result.timeoutInMs = copy.timeoutInMs;
}
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
}
}
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
return result;
}
exports.getDownloadOptions = getDownloadOptions;
Expand Down
13 changes: 12 additions & 1 deletion dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5473,6 +5473,7 @@ const util = __importStar(__webpack_require__(669));
const utils = __importStar(__webpack_require__(15));
const constants_1 = __webpack_require__(931);
const requestUtils_1 = __webpack_require__(899);
const abort_controller_1 = __webpack_require__(106);
/**
* Pipes the body of a HTTP response to a stream
*
Expand Down Expand Up @@ -5656,11 +5657,16 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
const fd = fs.openSync(archivePath, 'w');
try {
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()) {
const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize;
const segmentSize = Math.min(maxSegmentSize, contentLength - segmentStart);
downloadProgress.nextSegment(segmentSize);
const result = yield client.downloadToBuffer(segmentStart, segmentSize, {
abortSignal,
concurrency: options.downloadConcurrency,
onProgress: downloadProgress.onProgress()
});
Expand Down Expand Up @@ -40795,7 +40801,8 @@ function getDownloadOptions(copy) {
const result = {
useAzureSdk: true,
downloadConcurrency: 8,
timeoutInMs: 30000
timeoutInMs: 30000,
segmentTimeoutInMs: 3600000
};
if (copy) {
if (typeof copy.useAzureSdk === 'boolean') {
Expand All @@ -40807,10 +40814,14 @@ function getDownloadOptions(copy) {
if (typeof copy.timeoutInMs === 'number') {
result.timeoutInMs = copy.timeoutInMs;
}
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
}
}
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
return result;
}
exports.getDownloadOptions = getDownloadOptions;
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cache",
"version": "3.0.6",
"version": "3.0.7",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
Expand All @@ -23,7 +23,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.0.1",
"@actions/cache": "^3.0.2",
"@actions/core": "^1.7.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
Expand Down

0 comments on commit a404368

Please sign in to comment.