Skip to content

Commit 6f663d7

Browse files
TRAP Caching: Re-introduce workaround for download timeout
1 parent c939e66 commit 6f663d7

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

lib/trap-caching.js

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

lib/trap-caching.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/trap-caching.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,16 @@ export async function downloadTrapCaches(
113113
logger.info(
114114
`Looking in Actions cache for TRAP cache with key ${preferredKey}`
115115
);
116-
const found = await cache.restoreCache(
117-
[cacheDir],
118-
preferredKey,
119-
[
116+
const found = await withTimeout(
117+
MAX_CACHE_OPERATION_MS,
118+
cache.restoreCache([cacheDir], preferredKey, [
120119
// Fall back to any cache with the right key prefix
121120
await cachePrefix(codeql, language),
122-
],
123-
{
124-
segmentTimeoutInMs: MAX_CACHE_OPERATION_MS,
121+
]),
122+
() => {
123+
logger.info(
124+
`Timed out downloading cache for ${language}, will continue without it`
125+
);
125126
}
126127
);
127128
if (found === undefined) {

0 commit comments

Comments
 (0)