新增onServerReadyOnce事件,cluster模式下只触发一次,初始化任务事件改为onServerReadyOnce

This commit is contained in:
COOL 2025-06-20 11:37:29 +08:00
parent dd12136386
commit bd5b7852f0
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@
"description": "一个很酷的Ai快速开发框架",
"private": true,
"dependencies": {
"@cool-midway/core": "8.0.4",
"@cool-midway/core": "8.0.6",
"@cool-midway/rpc": "8.0.1",
"@cool-midway/task": "8.0.2",
"@midwayjs/bootstrap": "^3.20.3",

View File

@ -14,8 +14,9 @@ export class TaskCommEvent {
@Inject()
taskLocalService: TaskLocalService;
@Event('onServerReady')
async onServerReady() {
@Event('onServerReadyOnce')
async onServerReadyOnce() {
console.log('onServerReadyOnce', 'initTask');
this.taskInfoService.initTask();
}