mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 09:40:17 +08:00
Use delay instead of wait
Need to also change the signature of delay to allow this to happen.
This commit is contained in:
@@ -9,11 +9,11 @@ import { RepositoryNwo, parseRepositoryNwo } from "./repository";
|
||||
import * as uploadLib from "./upload-lib";
|
||||
import {
|
||||
codeQlVersionAbove,
|
||||
delay,
|
||||
getErrorMessage,
|
||||
getRequiredEnvParam,
|
||||
isInTestMode,
|
||||
parseMatrixInput,
|
||||
wait,
|
||||
wrapError,
|
||||
} from "./util";
|
||||
import {
|
||||
@@ -222,7 +222,7 @@ async function removeUploadedSarif(
|
||||
);
|
||||
|
||||
// Wait to make sure the analysis is ready for download before requesting it.
|
||||
await wait(5000);
|
||||
await delay(5000);
|
||||
|
||||
// Get the analysis associated with the uploaded sarif
|
||||
const analysisInfo = await client.request(
|
||||
|
||||
@@ -624,8 +624,9 @@ export async function bundleDb(
|
||||
*/
|
||||
export async function delay(
|
||||
milliseconds: number,
|
||||
{ allowProcessExit }: { allowProcessExit: boolean },
|
||||
opts?: { allowProcessExit: boolean },
|
||||
) {
|
||||
const { allowProcessExit } = opts || {};
|
||||
return new Promise((resolve) => {
|
||||
const timer = setTimeout(resolve, milliseconds);
|
||||
if (allowProcessExit) {
|
||||
@@ -913,10 +914,6 @@ export function getErrorMessage(error: unknown): string {
|
||||
return error instanceof Error ? error.toString() : String(error);
|
||||
}
|
||||
|
||||
export async function wait(ms: number) {
|
||||
await new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function prettyPrintPack(pack: Pack) {
|
||||
return `${pack.name}${pack.version ? `@${pack.version}` : ""}${
|
||||
pack.path ? `:${pack.path}` : ""
|
||||
|
||||
Reference in New Issue
Block a user