mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 14:40:10 +08:00
Rename withTimeout() to waitForResultWithTimeLimit()
The name withTimeout() gives the impression that it would limit the execution of the promise to the given time bound. But that is not the case: it is only the _waiting_ that is limited, and the promise would keep running beyond the time bound. This commit renames withTimeout() to waitForResultWithTimeLimit() so that developers are more likely to understand the actual behavior of this function.
This commit is contained in:
@@ -10,7 +10,11 @@ import { type CodeQL } from "./codeql";
|
||||
import { type Config } from "./config-utils";
|
||||
import { getCommitOid, getFileOidsUnderPath } from "./git-utils";
|
||||
import { Logger, withGroupAsync } from "./logging";
|
||||
import { isInTestMode, tryGetFolderBytes, withTimeout } from "./util";
|
||||
import {
|
||||
isInTestMode,
|
||||
tryGetFolderBytes,
|
||||
waitForResultWithTimeLimit,
|
||||
} from "./util";
|
||||
|
||||
export enum OverlayDatabaseMode {
|
||||
Overlay = "overlay",
|
||||
@@ -268,7 +272,7 @@ export async function uploadOverlayBaseDatabaseToCache(
|
||||
);
|
||||
|
||||
try {
|
||||
const cacheId = await withTimeout(
|
||||
const cacheId = await waitForResultWithTimeLimit(
|
||||
MAX_CACHE_OPERATION_MS,
|
||||
actionsCache.saveCache([dbLocation], cacheSaveKey),
|
||||
() => {},
|
||||
@@ -346,7 +350,7 @@ export async function downloadOverlayBaseDatabaseFromCache(
|
||||
let databaseDownloadDurationMs = 0;
|
||||
try {
|
||||
const databaseDownloadStart = performance.now();
|
||||
const foundKey = await withTimeout(
|
||||
const foundKey = await waitForResultWithTimeLimit(
|
||||
MAX_CACHE_OPERATION_MS,
|
||||
actionsCache.restoreCache([dbLocation], cacheRestoreKeyPrefix),
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user