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