fix: add __stopped event

This commit is contained in:
chenos 2025-03-23 10:11:06 +08:00
parent 436af4b9f3
commit bc5caab6f2
2 changed files with 2 additions and 1 deletions

View File

@ -305,7 +305,7 @@ export class AppSupervisor extends EventEmitter implements AsyncEmitter {
} }
}); });
app.on('afterStop', async () => { app.on('__stopped', async () => {
this.setAppStatus(app.name, 'stopped'); this.setAppStatus(app.name, 'stopped');
}); });

View File

@ -955,6 +955,7 @@ export class Application<StateT = DefaultState, ContextT = DefaultContext> exten
} }
await this.emitAsync('afterStop', this, options); await this.emitAsync('afterStop', this, options);
this.emit('__stopped', this, options);
this.stopped = true; this.stopped = true;
log.info(`app has stopped`, { method: 'stop' }); log.info(`app has stopped`, { method: 'stop' });