TRAP Caching: Re-introduce workaround for download timeout
This commit is contained in:
parent
c939e6615d
commit
bfc56625b0
6 changed files with 16 additions and 12 deletions
|
|
@ -29,6 +29,7 @@ import { parseRepositoryNwo } from "./repository";
|
|||
import { getTotalCacheSize } from "./trap-caching";
|
||||
import {
|
||||
checkActionVersion,
|
||||
checkForTimeout,
|
||||
checkGitHubVersionInRange,
|
||||
codeQlVersionAbove,
|
||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
|
|
@ -332,6 +333,7 @@ async function runWrapper() {
|
|||
core.setFailed(`init action failed: ${error}`);
|
||||
console.log(error);
|
||||
}
|
||||
await checkForTimeout();
|
||||
}
|
||||
|
||||
void runWrapper();
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue