feat: add autoConfig/ better types for wrapperData

This commit is contained in:
BluJ
2023-04-19 17:23:16 -06:00
parent 7c4f94ba8f
commit e279711f8e
39 changed files with 431 additions and 291 deletions

View File

@@ -22,7 +22,7 @@ export async function checkPortListening(
{
error = `Port ${port} is not listening`,
message = `Port ${port} is available`,
} = {}
} = {},
): Promise<CheckResult> {
const hasAddress =
containsAddress(await effects.runCommand(`cat /proc/net/tcp`), port) ||

View File

@@ -15,7 +15,7 @@ export const checkWebUrl = async (
timeout = 1000,
successMessage = `Reached ${url}`,
errorMessage = `Error while fetching URL: ${url}`,
} = {}
} = {},
): Promise<CheckResult> => {
return Promise.race([effects.fetch(url), timeoutPromise(timeout)])
.then((x) => ({

View File

@@ -5,7 +5,7 @@ export { checkWebUrl } from "./checkWebUrl";
export function timeoutPromise(ms: number, { message = "Timed out" } = {}) {
return new Promise<never>((resolve, reject) =>
setTimeout(() => reject(new Error(message)), ms)
setTimeout(() => reject(new Error(message)), ms),
);
}
export { runHealthScript };

View File

@@ -17,7 +17,7 @@ export const runHealthScript = async <A extends string>(
errorMessage = `Error while running command: ${runCommand}`,
message = (res: string) =>
`Have ran script ${runCommand} and the result: ${res}`,
} = {}
} = {},
): Promise<CheckResult> => {
const res = await Promise.race([
effects.runCommand(runCommand, { timeoutMillis: timeout }),