From d8dfea6c6dc2542221cc63767c7a2e3c39c4eb78 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Wed, 5 Jul 2023 10:43:19 +0200 Subject: [PATCH] use highlevel actions cache api with key-prefix --- dist/index.js | 6 ++++-- src/classes/actions-cache-hilevel/download.ts | 4 +++- src/classes/state/state.ts | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 83915fab..a67fd4ee 100644 --- a/dist/index.js +++ b/dist/index.js @@ -36,7 +36,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.downloadFileFromActionsCache = void 0; const cache = __importStar(__nccwpck_require__(7799)); const path_1 = __importDefault(__nccwpck_require__(1017)); -const downloadFileFromActionsCache = (destFileName, cacheKey, cacheVersion) => cache.restoreCache([path_1.default.dirname(destFileName)], cacheKey); +const downloadFileFromActionsCache = (destFileName, cacheKey, cacheVersion) => cache.restoreCache([path_1.default.dirname(destFileName)], cacheKey, [ + cacheKey +]); exports.downloadFileFromActionsCache = downloadFileFromActionsCache; @@ -1815,7 +1817,7 @@ class State { this.reset(); const serialized = yield this.stateStorage.restore(); this.deserialize(serialized); - core.info(`state: rehydrated with info about ${this.processedIssuesIDs.size} issue(s)`); + core.info(`state: restored with info about ${this.processedIssuesIDs.size} issue(s)`); }); } } diff --git a/src/classes/actions-cache-hilevel/download.ts b/src/classes/actions-cache-hilevel/download.ts index 8fe32a8a..d1792443 100644 --- a/src/classes/actions-cache-hilevel/download.ts +++ b/src/classes/actions-cache-hilevel/download.ts @@ -6,4 +6,6 @@ export const downloadFileFromActionsCache = ( cacheKey: string, cacheVersion: string ): Promise => - cache.restoreCache([path.dirname(destFileName)], cacheKey) as Promise; + cache.restoreCache([path.dirname(destFileName)], cacheKey, [ + cacheKey + ]) as Promise; diff --git a/src/classes/state/state.ts b/src/classes/state/state.ts index a8ea29bd..c734d8c8 100644 --- a/src/classes/state/state.ts +++ b/src/classes/state/state.ts @@ -65,7 +65,7 @@ export class State implements IState { const serialized = await this.stateStorage.restore(); this.deserialize(serialized); core.info( - `state: rehydrated with info about ${this.processedIssuesIDs.size} issue(s)` + `state: restored with info about ${this.processedIssuesIDs.size} issue(s)` ); } }