mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 18:31:52 +00:00
chore: Update and fix the things
This commit is contained in:
@@ -179,7 +179,6 @@ export class Checker {
|
||||
* @returns
|
||||
*/
|
||||
static parse(range: string | Checker): Checker {
|
||||
console.log(`Parser (${range})`)
|
||||
if (range instanceof Checker) {
|
||||
return range
|
||||
}
|
||||
|
||||
@@ -40,19 +40,21 @@ export function healthCheck(o: {
|
||||
const { status, message } = await o.fn(overlay)
|
||||
await o.effects.setHealth({
|
||||
name: o.name,
|
||||
status,
|
||||
message,
|
||||
id: o.name,
|
||||
result: status,
|
||||
message: message || "",
|
||||
})
|
||||
currentValue.hadSuccess = true
|
||||
currentValue.lastResult = "passing"
|
||||
currentValue.lastResult = "success"
|
||||
await triggerFirstSuccess().catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
} catch (e) {
|
||||
await o.effects.setHealth({
|
||||
name: o.name,
|
||||
status: "failure",
|
||||
message: asMessage(e),
|
||||
id: o.name,
|
||||
result: "failure",
|
||||
message: asMessage(e) || "",
|
||||
})
|
||||
currentValue.lastResult = "failure"
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export async function checkPortListening(
|
||||
port,
|
||||
)
|
||||
if (hasAddress) {
|
||||
return { status: "passing", message: options.successMessage }
|
||||
return { status: "success", message: options.successMessage }
|
||||
}
|
||||
return {
|
||||
status: "failure",
|
||||
|
||||
@@ -22,7 +22,7 @@ export const checkWebUrl = async (
|
||||
.then(
|
||||
(x) =>
|
||||
({
|
||||
status: "passing",
|
||||
status: "success",
|
||||
message: successMessage,
|
||||
}) as const,
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ export const runHealthScript = async (
|
||||
throw { status: "failure", message: errorMessage } as CheckResult
|
||||
})
|
||||
return {
|
||||
status: "passing",
|
||||
status: "success",
|
||||
message: message(res.stdout.toString()),
|
||||
} as CheckResult
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ export class Daemons<Manifest extends SDKManifest, Ids extends string> {
|
||||
}) as CheckResult,
|
||||
)
|
||||
currentInput.lastResult = response.status || null
|
||||
if (!currentInput.hadSuccess && response.status === "passing") {
|
||||
if (!currentInput.hadSuccess && response.status === "success") {
|
||||
currentInput.hadSuccess = true
|
||||
resolve(child)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export function changeOnFirstSuccess(o: {
|
||||
beforeFirstSuccess.next()
|
||||
for (
|
||||
let res = await beforeFirstSuccess.next();
|
||||
currentValue?.lastResult !== "passing" && !res.done;
|
||||
currentValue?.lastResult !== "success" && !res.done;
|
||||
res = await beforeFirstSuccess.next()
|
||||
) {
|
||||
yield
|
||||
|
||||
@@ -12,7 +12,7 @@ export function successFailure(o: {
|
||||
beforeSuccess.next()
|
||||
for (
|
||||
let res = await beforeSuccess.next();
|
||||
currentValue?.lastResult !== "passing" && !res.done;
|
||||
currentValue?.lastResult !== "success" && !res.done;
|
||||
res = await beforeSuccess.next()
|
||||
) {
|
||||
yield
|
||||
@@ -21,7 +21,7 @@ export function successFailure(o: {
|
||||
const duringError = o.duringError(getInput)
|
||||
for (
|
||||
let res = await duringError.next();
|
||||
currentValue?.lastResult === "passing" && !res.done;
|
||||
currentValue?.lastResult === "success" && !res.done;
|
||||
res = await duringError.next()
|
||||
) {
|
||||
yield
|
||||
|
||||
@@ -143,13 +143,7 @@ export type Daemon = {
|
||||
[DaemonProof]: never
|
||||
}
|
||||
|
||||
export type HealthStatus =
|
||||
| `passing`
|
||||
| `disabled`
|
||||
| `starting`
|
||||
| `warning`
|
||||
| `failure`
|
||||
|
||||
export type HealthStatus = HealthCheckResult["result"]
|
||||
export type SmtpValue = {
|
||||
server: string
|
||||
port: number
|
||||
|
||||
Reference in New Issue
Block a user