Skip to content

Commit adb2896

Browse files
committedOct 11, 2022
Further update to reflect a conversation with @henrymercer
1 parent 6e1dab2 commit adb2896

21 files changed

+131
-79
lines changed
 

‎lib/trap-caching.js

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/trap-caching.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/util.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/util.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/.package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/README.md

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/cacheUtils.js

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/cacheUtils.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/downloadUtils.js

+23-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/downloadUtils.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/tar.d.ts

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/tar.js

+38-42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/internal/tar.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/options.d.ts

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/options.js

+13-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/lib/options.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎node_modules/@actions/cache/package.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"license": "MIT",
2323
"dependencies": {
2424
"@actions/artifact": "^1.0.0",
25-
"@actions/cache": "^3.0.0",
25+
"@actions/cache": "^3.0.4",
2626
"@actions/core": "^1.9.1",
2727
"@actions/exec": "^1.1.0",
2828
"@actions/github": "^4.0.0",

‎src/trap-caching.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ export async function downloadTrapCaches(
113113
logger.info(
114114
`Looking in Actions cache for TRAP cache with key ${preferredKey}`
115115
);
116-
const found = await withTimeout(
117-
MAX_CACHE_OPERATION_MS,
118-
cache.restoreCache([cacheDir], preferredKey, [
119-
await cachePrefix(codeql, language), // Fall back to any cache with the right key prefix
120-
]),
121-
() => {
122-
logger.info(
123-
`Timed out waiting for TRAP cache download for ${language}, will continue without it`
124-
);
116+
const found = await cache.restoreCache(
117+
[cacheDir],
118+
preferredKey,
119+
[
120+
// Fall back to any cache with the right key prefix
121+
await cachePrefix(codeql, language),
122+
],
123+
{
124+
segmentTimeoutInMs: MAX_CACHE_OPERATION_MS,
125125
}
126126
);
127127
if (found === undefined) {

‎src/util.ts

+3
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,9 @@ export async function tryGetFolderBytes(
899899
* Run a promise for a given amount of time, and if it doesn't resolve within
900900
* that time, call the provided callback and then return undefined.
901901
*
902+
* Note that this does NOT cancel the original promise, so that promise will
903+
* continue in the background even after the timeout has expired.
904+
*
902905
* @param timeoutMs The timeout in milliseconds.
903906
* @param promise The promise to run.
904907
* @param onTimeout A callback to call if the promise times out.

0 commit comments

Comments
 (0)
Please sign in to comment.