From d59a1464f2d981ca686dc10c47b3759c86c337d7 Mon Sep 17 00:00:00 2001 From: Dave Hadka Date: Tue, 21 Jul 2020 11:04:17 -0500 Subject: [PATCH] Upgrade to cache 1.0.1 --- dist/restore/index.js | 7 ++++--- dist/save/index.js | 7 ++++--- package-lock.json | 6 +++--- package.json | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index d475ec1..75adf27 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -1022,7 +1022,7 @@ const semver = __importStar(__webpack_require__(280)); const util = __importStar(__webpack_require__(669)); const uuid_1 = __webpack_require__(898); const constants_1 = __webpack_require__(931); -// From https://github.com/actions/toolkit/blob/master/packages/tool-cache/src/tool-cache.ts#L23 +// From https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L23 function createTempDirectory() { return __awaiter(this, void 0, void 0, function* () { const IS_WINDOWS = process.platform === 'win32'; @@ -4444,9 +4444,10 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) { try { downloadProgress.startDisplayTimer(); while (!downloadProgress.isDone()) { - const segmentSize = Math.min(maxSegmentSize, contentLength - downloadProgress.segmentOffset); + const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize; + const segmentSize = Math.min(maxSegmentSize, contentLength - segmentStart); downloadProgress.nextSegment(segmentSize); - const result = yield client.downloadToBuffer(downloadProgress.segmentOffset, segmentSize, { + const result = yield client.downloadToBuffer(segmentStart, segmentSize, { concurrency: options.downloadConcurrency, onProgress: downloadProgress.onProgress() }); diff --git a/dist/save/index.js b/dist/save/index.js index 60454e9..7d8e391 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -1022,7 +1022,7 @@ const semver = __importStar(__webpack_require__(280)); const util = __importStar(__webpack_require__(669)); const uuid_1 = __webpack_require__(898); const constants_1 = __webpack_require__(931); -// From https://github.com/actions/toolkit/blob/master/packages/tool-cache/src/tool-cache.ts#L23 +// From https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L23 function createTempDirectory() { return __awaiter(this, void 0, void 0, function* () { const IS_WINDOWS = process.platform === 'win32'; @@ -4444,9 +4444,10 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) { try { downloadProgress.startDisplayTimer(); while (!downloadProgress.isDone()) { - const segmentSize = Math.min(maxSegmentSize, contentLength - downloadProgress.segmentOffset); + const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize; + const segmentSize = Math.min(maxSegmentSize, contentLength - segmentStart); downloadProgress.nextSegment(segmentSize); - const result = yield client.downloadToBuffer(downloadProgress.segmentOffset, segmentSize, { + const result = yield client.downloadToBuffer(segmentStart, segmentSize, { concurrency: options.downloadConcurrency, onProgress: downloadProgress.onProgress() }); diff --git a/package-lock.json b/package-lock.json index 8dfd47a..150a289 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@actions/cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.0.tgz", - "integrity": "sha512-4gF8XNRhZpFNZJL/rzlnZ2H63P+3USLamvhkhIv5v2JKkEkRvgGVnaQ3kY0LAwYXai82U1wVQhn9cegIUxgRQg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.1.tgz", + "integrity": "sha512-QyMKGZTVB6bRBIMNEoW74LeqYtbY7cSaWNvaT1uqhzjredaW+vNFxv9XF/cyipzwZBVZgizOF2zpdVYnP0UVYg==", "requires": { "@actions/core": "^1.2.4", "@actions/exec": "^1.0.1", diff --git a/package.json b/package.json index 665c184..7763b8d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@actions/core": "^1.2.0", "@actions/exec": "^1.0.1", "@actions/io": "^1.0.1", - "@actions/cache": "^1.0.0" + "@actions/cache": "^1.0.1" }, "devDependencies": { "@types/jest": "^24.0.13",