chore: skip app supervisor (#4937)

This commit is contained in:
ChengLei Shao 2024-07-23 22:58:45 +08:00 committed by GitHub
parent 31997b05f5
commit 1776af73ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,6 +116,7 @@ export interface ApplicationOptions {
*/ */
perfHooks?: boolean; perfHooks?: boolean;
telemetry?: AppTelemetryOptions; telemetry?: AppTelemetryOptions;
skipSupervisor?: boolean;
} }
export interface DefaultState extends KoaDefaultState { export interface DefaultState extends KoaDefaultState {
@ -235,7 +236,9 @@ export class Application<StateT = DefaultState, ContextT = DefaultContext> exten
this.rawOptions = this.name == 'main' ? lodash.cloneDeep(options) : {}; this.rawOptions = this.name == 'main' ? lodash.cloneDeep(options) : {};
this.init(); this.init();
this._appSupervisor.addApp(this); if (!options.skipSupervisor) {
this._appSupervisor.addApp(this);
}
} }
/** /**