Commit e839c259 authored by Sankalp Kotewar's avatar Sankalp Kotewar
Browse files

Updated actions/cache version to 3.0.3

parent 33a923d6
Loading
Loading
Loading
Loading
+20 −6
Changes for dist/restore/index.js: 20 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -5657,22 +5657,26 @@ 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.');
                });
                const controller = new abort_controller_1.AbortController();
                const abortSignal = controller.signal;
                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, {
                    const result = yield promiseWithTimeout(options.segmentTimeoutInMs || 3600000, client.downloadToBuffer(segmentStart, segmentSize, {
                        abortSignal,
                        concurrency: options.downloadConcurrency,
                        onProgress: downloadProgress.onProgress()
                    });
                    }));
                    if (result === 'timeout') {
                        controller.abort();
                        throw new Error('Aborting cache download as the download time exceeded the timeout.');
                    }
                    else if (Buffer.isBuffer(result)) {
                        fs.writeFileSync(fd, result);
                    }
                }
            }
            finally {
                downloadProgress.stopDisplayTimer();
                fs.closeSync(fd);
@@ -5681,6 +5685,16 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
    });
}
exports.downloadCacheStorageSDK = downloadCacheStorageSDK;
const promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, void 0, function* () {
    let timeoutHandle;
    const timeoutPromise = new Promise(resolve => {
        timeoutHandle = setTimeout(() => resolve('timeout'), timeoutMs);
    });
    return Promise.race([promise, timeoutPromise]).then(result => {
        clearTimeout(timeoutHandle);
        return result;
    });
});
//# sourceMappingURL=downloadUtils.js.map
/***/ }),
+20 −6
Changes for dist/save/index.js: 20 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -5657,22 +5657,26 @@ 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.');
                });
                const controller = new abort_controller_1.AbortController();
                const abortSignal = controller.signal;
                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, {
                    const result = yield promiseWithTimeout(options.segmentTimeoutInMs || 3600000, client.downloadToBuffer(segmentStart, segmentSize, {
                        abortSignal,
                        concurrency: options.downloadConcurrency,
                        onProgress: downloadProgress.onProgress()
                    });
                    }));
                    if (result === 'timeout') {
                        controller.abort();
                        throw new Error('Aborting cache download as the download time exceeded the timeout.');
                    }
                    else if (Buffer.isBuffer(result)) {
                        fs.writeFileSync(fd, result);
                    }
                }
            }
            finally {
                downloadProgress.stopDisplayTimer();
                fs.closeSync(fd);
@@ -5681,6 +5685,16 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
    });
}
exports.downloadCacheStorageSDK = downloadCacheStorageSDK;
const promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, void 0, function* () {
    let timeoutHandle;
    const timeoutPromise = new Promise(resolve => {
        timeoutHandle = setTimeout(() => resolve('timeout'), timeoutMs);
    });
    return Promise.race([promise, timeoutPromise]).then(result => {
        clearTimeout(timeoutHandle);
        return result;
    });
});
//# sourceMappingURL=downloadUtils.js.map
/***/ }),
+7 −7
Changes for package-lock.json: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
      "version": "3.0.7",
      "license": "MIT",
      "dependencies": {
        "@actions/cache": "^3.0.2",
        "@actions/cache": "^3.0.3",
        "@actions/core": "^1.7.0",
        "@actions/exec": "^1.1.1",
        "@actions/io": "^1.1.2"
@@ -36,9 +36,9 @@
      }
    },
    "node_modules/@actions/cache": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.2.tgz",
      "integrity": "sha512-XGhWOYgMr3ZHxZ07uFis7dHM1/3xgwASPEm4i5Tb6ag6NbvLY86bb3Nik/EKWV2w1jUTdKEpim5EBalo+glzZQ==",
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.3.tgz",
      "integrity": "sha512-kn0pZRQNFRg1IQnW/N7uTNbbLqYalvQW2bmrznn3C34LMY/rSuEmH6Uo69HDh335Q0vKs9kg/jsIarzUBKzEXg==",
      "dependencies": {
        "@actions/core": "^1.2.6",
        "@actions/exec": "^1.0.1",
@@ -9533,9 +9533,9 @@
  },
  "dependencies": {
    "@actions/cache": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.2.tgz",
      "integrity": "sha512-XGhWOYgMr3ZHxZ07uFis7dHM1/3xgwASPEm4i5Tb6ag6NbvLY86bb3Nik/EKWV2w1jUTdKEpim5EBalo+glzZQ==",
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.3.tgz",
      "integrity": "sha512-kn0pZRQNFRg1IQnW/N7uTNbbLqYalvQW2bmrznn3C34LMY/rSuEmH6Uo69HDh335Q0vKs9kg/jsIarzUBKzEXg==",
      "requires": {
        "@actions/core": "^1.2.6",
        "@actions/exec": "^1.0.1",
+1 −1
Changes for package.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
  "author": "GitHub",
  "license": "MIT",
  "dependencies": {
    "@actions/cache": "^3.0.2",
    "@actions/cache": "^3.0.3",
    "@actions/core": "^1.7.0",
    "@actions/exec": "^1.1.1",
    "@actions/io": "^1.1.2"