Skip to content

Commit

Permalink
TRAP Caching: Re-introduce workaround for download timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardopirovano committed Nov 16, 2022
1 parent c939e66 commit 6f663d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/trap-caching.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/trap-caching.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/trap-caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ export async function downloadTrapCaches(
logger.info(
`Looking in Actions cache for TRAP cache with key ${preferredKey}`
);
const found = await cache.restoreCache(
[cacheDir],
preferredKey,
[
const found = await withTimeout(
MAX_CACHE_OPERATION_MS,
cache.restoreCache([cacheDir], preferredKey, [
// Fall back to any cache with the right key prefix
await cachePrefix(codeql, language),
],
{
segmentTimeoutInMs: MAX_CACHE_OPERATION_MS,
]),
() => {
logger.info(
`Timed out downloading cache for ${language}, will continue without it`
);
}
);
if (found === undefined) {
Expand Down

0 comments on commit 6f663d7

Please sign in to comment.