Further update to reflect a conversation with @henrymercer
This commit is contained in:
parent
6e1dab28b6
commit
adb28963c0
21 changed files with 131 additions and 79 deletions
9
lib/trap-caching.js
generated
9
lib/trap-caching.js
generated
|
|
@ -100,10 +100,11 @@ async function downloadTrapCaches(codeql, languages, logger) {
|
|||
// The SHA from the base of the PR is the most similar commit we might have a cache for
|
||||
const preferredKey = await cacheKey(codeql, language, baseSha);
|
||||
logger.info(`Looking in Actions cache for TRAP cache with key ${preferredKey}`);
|
||||
const found = await (0, util_1.withTimeout)(MAX_CACHE_OPERATION_MS, cache.restoreCache([cacheDir], preferredKey, [
|
||||
await cachePrefix(codeql, language), // Fall back to any cache with the right key prefix
|
||||
]), () => {
|
||||
logger.info(`Timed out waiting for TRAP cache download for ${language}, will continue without it`);
|
||||
const found = await cache.restoreCache([cacheDir], preferredKey, [
|
||||
// Fall back to any cache with the right key prefix
|
||||
await cachePrefix(codeql, language),
|
||||
], {
|
||||
segmentTimeoutInMs: MAX_CACHE_OPERATION_MS,
|
||||
});
|
||||
if (found === undefined) {
|
||||
// We didn't find a TRAP cache in the Actions cache, so the directory on disk is
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
3
lib/util.js
generated
3
lib/util.js
generated
|
|
@ -748,6 +748,9 @@ exports.tryGetFolderBytes = tryGetFolderBytes;
|
|||
* Run a promise for a given amount of time, and if it doesn't resolve within
|
||||
* that time, call the provided callback and then return undefined.
|
||||
*
|
||||
* Note that this does NOT cancel the original promise, so that promise will
|
||||
* continue in the background even after the timeout has expired.
|
||||
*
|
||||
* @param timeoutMs The timeout in milliseconds.
|
||||
* @param promise The promise to run.
|
||||
* @param onTimeout A callback to call if the promise times out.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue