mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
* feature: Adding in the stopping state * chore: Deal with timeout in the sigterm for main * chore: Update the timeout * Update web/projects/ui/src/app/pages/apps-routes/app-list/app-list-pkg/app-list-pkg.component.ts Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> * Update web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-status/app-show-status.component.ts Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
32 lines
952 B
TypeScript
32 lines
952 B
TypeScript
import { ExpectedExports } from "../types"
|
|
import { Daemons } from "./Daemons"
|
|
import "../interfaces/ServiceInterfaceBuilder"
|
|
import "../interfaces/Origin"
|
|
|
|
import "./Daemons"
|
|
import { SDKManifest } from "../manifest/ManifestTypes"
|
|
import { MainEffects } from "../StartSdk"
|
|
|
|
export const DEFAULT_SIGTERM_TIMEOUT = 30_000
|
|
/**
|
|
* Used to ensure that the main function is running with the valid proofs.
|
|
* We first do the folowing order of things
|
|
* 1. We get the interfaces
|
|
* 2. We setup all the commands to setup the system
|
|
* 3. We create the health checks
|
|
* 4. We setup the daemons init system
|
|
* @param fn
|
|
* @returns
|
|
*/
|
|
export const setupMain = <Manifest extends SDKManifest, Store>(
|
|
fn: (o: {
|
|
effects: MainEffects
|
|
started(onTerm: () => PromiseLike<void>): PromiseLike<void>
|
|
}) => Promise<Daemons<Manifest, any>>,
|
|
): ExpectedExports.main => {
|
|
return async (options) => {
|
|
const result = await fn(options)
|
|
return result
|
|
}
|
|
}
|