Feat/next packages (#2646)

* fix mac build

* wip

* chore: Update the effects to get rid of bad pattern

* chore: Some small changes

* wip

* fix: Health checks don't show during race

* fix: Restart working

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Jade
2024-06-19 17:30:05 -06:00
committed by GitHub
parent da3720c7a9
commit 355452cdb3
7 changed files with 65 additions and 34 deletions

View File

@@ -123,9 +123,9 @@ export class SystemForStartOs implements System {
return this.abi.uninit({ effects, nextVersion })
}
case "/main/start": {
if (this.onTerm) await this.onTerm()
const started = async (onTerm: () => Promise<void>) => {
await effects.setMainStatus({ status: "running" })
if (this.onTerm) await this.onTerm()
this.onTerm = onTerm
}
const daemons = await (
@@ -135,10 +135,11 @@ export class SystemForStartOs implements System {
})
).build()
this.onTerm = daemons.term
return
}
case "/main/stop": {
await effects.setMainStatus({ status: "stopped" })
if (this.onTerm) await this.onTerm()
await effects.setMainStatus({ status: "stopped" })
delete this.onTerm
return duration(30, "s")
}
@@ -183,6 +184,7 @@ export class SystemForStartOs implements System {
return dependencyConfig.update(options.input as any) // TODO
}
}
return
}
throw new Error(`Method ${options.procedure} not implemented.`)
}