1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-11-23 20:19:16 +01:00

Upgrade to cache 1.0.1

This commit is contained in:
Dave Hadka 2020-07-21 11:04:17 -05:00
parent 481a91ba10
commit d59a1464f2
4 changed files with 12 additions and 10 deletions

View file

@ -1022,7 +1022,7 @@ const semver = __importStar(__webpack_require__(280));
const util = __importStar(__webpack_require__(669)); const util = __importStar(__webpack_require__(669));
const uuid_1 = __webpack_require__(898); const uuid_1 = __webpack_require__(898);
const constants_1 = __webpack_require__(931); 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() { function createTempDirectory() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
@ -4444,9 +4444,10 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
try { try {
downloadProgress.startDisplayTimer(); downloadProgress.startDisplayTimer();
while (!downloadProgress.isDone()) { 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); downloadProgress.nextSegment(segmentSize);
const result = yield client.downloadToBuffer(downloadProgress.segmentOffset, segmentSize, { const result = yield client.downloadToBuffer(segmentStart, segmentSize, {
concurrency: options.downloadConcurrency, concurrency: options.downloadConcurrency,
onProgress: downloadProgress.onProgress() onProgress: downloadProgress.onProgress()
}); });

7
dist/save/index.js vendored
View file

@ -1022,7 +1022,7 @@ const semver = __importStar(__webpack_require__(280));
const util = __importStar(__webpack_require__(669)); const util = __importStar(__webpack_require__(669));
const uuid_1 = __webpack_require__(898); const uuid_1 = __webpack_require__(898);
const constants_1 = __webpack_require__(931); 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() { function createTempDirectory() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
@ -4444,9 +4444,10 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
try { try {
downloadProgress.startDisplayTimer(); downloadProgress.startDisplayTimer();
while (!downloadProgress.isDone()) { 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); downloadProgress.nextSegment(segmentSize);
const result = yield client.downloadToBuffer(downloadProgress.segmentOffset, segmentSize, { const result = yield client.downloadToBuffer(segmentStart, segmentSize, {
concurrency: options.downloadConcurrency, concurrency: options.downloadConcurrency,
onProgress: downloadProgress.onProgress() onProgress: downloadProgress.onProgress()
}); });

6
package-lock.json generated
View file

@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/cache": { "@actions/cache": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.1.tgz",
"integrity": "sha512-4gF8XNRhZpFNZJL/rzlnZ2H63P+3USLamvhkhIv5v2JKkEkRvgGVnaQ3kY0LAwYXai82U1wVQhn9cegIUxgRQg==", "integrity": "sha512-QyMKGZTVB6bRBIMNEoW74LeqYtbY7cSaWNvaT1uqhzjredaW+vNFxv9XF/cyipzwZBVZgizOF2zpdVYnP0UVYg==",
"requires": { "requires": {
"@actions/core": "^1.2.4", "@actions/core": "^1.2.4",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",

View file

@ -26,7 +26,7 @@
"@actions/core": "^1.2.0", "@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
"@actions/io": "^1.0.1", "@actions/io": "^1.0.1",
"@actions/cache": "^1.0.0" "@actions/cache": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^24.0.13", "@types/jest": "^24.0.13",