mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 22:50: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:
@@ -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