mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +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:
@@ -10,19 +10,25 @@ import { DaemonCommandType } from "./Daemons"
|
||||
* unlike Daemon, does not restart on success
|
||||
*/
|
||||
|
||||
export class Oneshot<Manifest extends T.SDKManifest> extends Daemon<Manifest> {
|
||||
export class Oneshot<
|
||||
Manifest extends T.SDKManifest,
|
||||
C extends SubContainer<Manifest> | null = SubContainer<Manifest> | null,
|
||||
> extends Daemon<Manifest, C> {
|
||||
static of<Manifest extends T.SDKManifest>() {
|
||||
return async (
|
||||
return async <C extends SubContainer<Manifest> | null>(
|
||||
effects: T.Effects,
|
||||
subcontainer: SubContainer<Manifest>,
|
||||
exec: DaemonCommandType | null,
|
||||
subcontainer: C,
|
||||
exec: DaemonCommandType<Manifest, C>,
|
||||
) => {
|
||||
if (subcontainer.isOwned()) subcontainer = subcontainer.rc()
|
||||
const startCommand = exec
|
||||
? () =>
|
||||
CommandController.of<Manifest>()(effects, subcontainer.rc(), exec)
|
||||
: null
|
||||
return new Oneshot(subcontainer, startCommand, true)
|
||||
let subc: SubContainer<Manifest> | null = subcontainer
|
||||
if (subcontainer && subcontainer.isOwned()) subc = subcontainer.rc()
|
||||
const startCommand = () =>
|
||||
CommandController.of<Manifest, C>()(
|
||||
effects,
|
||||
(subc?.rc() ?? null) as C,
|
||||
exec,
|
||||
)
|
||||
return new Oneshot<Manifest, C>(subcontainer, startCommand, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user