mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
addHealthCheck instead of additionalHealthChecks for Daemons (#2962)
* addHealthCheck on Daemons * fix bug that prevents domains without protocols from being deleted * fixes from testing * version bump * add sdk version to UI * fix useEntrypoint * fix dependency health check error display * minor fixes * beta.29 * fixes from testing * beta.30 * set /etc/os-release (#2918) * remove check-monitor from kiosk (#2059) * add units for progress (#2693) * use new progress type * alpha.7 * fix up pwa stuff * fix wormhole-squashfs and prune boot (#2964) * don't exit on expected errors * use bash --------- Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -12,7 +12,6 @@ export type HealthCheckParams = {
|
||||
trigger?: Trigger
|
||||
gracePeriod?: number
|
||||
fn(): Promise<HealthCheckResult> | HealthCheckResult
|
||||
onFirstSuccess?: () => unknown | Promise<unknown>
|
||||
}
|
||||
|
||||
export class HealthCheck extends Drop {
|
||||
@@ -32,13 +31,6 @@ export class HealthCheck extends Drop {
|
||||
const getCurrentValue = () => this.currentValue
|
||||
const gracePeriod = o.gracePeriod ?? 10_000
|
||||
const trigger = (o.trigger ?? defaultTrigger)(getCurrentValue)
|
||||
const triggerFirstSuccess = once(() =>
|
||||
Promise.resolve(
|
||||
"onFirstSuccess" in o && o.onFirstSuccess
|
||||
? o.onFirstSuccess()
|
||||
: undefined,
|
||||
),
|
||||
)
|
||||
const checkStarted = () =>
|
||||
[
|
||||
this.started,
|
||||
@@ -78,9 +70,6 @@ export class HealthCheck extends Drop {
|
||||
message: message || "",
|
||||
})
|
||||
this.currentValue.lastResult = result
|
||||
await triggerFirstSuccess().catch((err) => {
|
||||
console.error(asError(err))
|
||||
})
|
||||
} catch (e) {
|
||||
await effects.setHealth({
|
||||
name: o.name,
|
||||
|
||||
Reference in New Issue
Block a user