fix: shutdown order (#3073)

* fix: race condition in Daemon.stop()

* fix: do not stop Daemon on context leave

* fix: remove duplicate Daemons.term calls

* feat: honor dependency order when shutting terminating Daemons

* fixes, and remove started

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Remco Ros
2025-12-15 23:21:23 +01:00
committed by GitHub
parent 0430e0f930
commit 9c43c43a46
14 changed files with 131 additions and 100 deletions

View File

@@ -67,7 +67,7 @@ export type Effects = {
packageId?: PackageId
callback?: () => void
}): Promise<StatusInfo>
/** indicate to the host os what runstate the service is in */
/** DEPRECATED: indicate to the host os what runstate the service is in */
setMainStatus(options: SetMainStatus): Promise<null>
// dependency

View File

@@ -44,10 +44,7 @@ export namespace ExpectedExports {
* This is the entrypoint for the main container. Used to start up something like the service that the
* package represents, like running a bitcoind in a bitcoind-wrapper.
*/
export type main = (options: {
effects: Effects
started(onTerm: () => PromiseLike<void>): PromiseLike<null>
}) => Promise<DaemonBuildable>
export type main = (options: { effects: Effects }) => Promise<DaemonBuildable>
/**
* Every time a service launches (both on startup, and on install) this function is called before packageInit