Skip to content

Commit f460dc7

Browse files
authored
Merge pull request #4206 from github/mbg/set-restore-keys
Include primary cache keys as restore key
2 parents f5b8e09 + 0993337 commit f460dc7

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/dependency-caching.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ export async function downloadDependencyCaches(
313313

314314
const primaryKey = await cacheKey(codeql, features, language, patterns);
315315
const restoreKeys: string[] = [
316+
primaryKey,
316317
await cachePrefix(codeql, features, language),
317318
];
318319

‎src/overlay/caching.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export async function downloadOverlayBaseDatabaseFromCache(
290290
actionsCache.restoreCache(
291291
[dbLocation],
292292
cacheRestoreKeyPrefix,
293-
undefined,
293+
[cacheRestoreKeyPrefix],
294294
{
295295
// Azure SDK download (which is the default) uses 128MB segments; see
296296
// https://github.com/actions/toolkit/blob/main/packages/cache/README.md.

‎src/overlay/status.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export async function getOverlayStatus(
130130
await fs.promises.mkdir(path.dirname(statusFile), { recursive: true });
131131
const foundKey = await waitForResultWithTimeLimit(
132132
MAX_CACHE_OPERATION_MS,
133-
actionsCache.restoreCache([statusFile], cacheKey),
133+
actionsCache.restoreCache([statusFile], cacheKey, [cacheKey]),
134134
() => {
135135
logger.warning("Timed out restoring overlay status from cache.");
136136
},

‎src/trap-caching.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export async function downloadTrapCaches(
9999
const found = await waitForResultWithTimeLimit(
100100
MAX_CACHE_OPERATION_MS,
101101
actionsCache.restoreCache([cacheDir], preferredKey, [
102+
preferredKey,
102103
// Fall back to any cache with the right key prefix
103104
await cachePrefix(codeql, language),
104105
]),

0 commit comments

Comments
 (0)