将Watcher改成串行,socket.io升级

This commit is contained in:
Xu Chang 2025-01-13 14:00:41 +08:00
parent 6dcf718007
commit 3e489e7b9e
3 changed files with 9 additions and 3 deletions

View File

@ -371,7 +371,10 @@ class AppLoader extends types_1.AppLoader {
count++;
const start = Date.now();
for (const w of totalWatchers) {
execOne(w, start);
/**
* todo 原来这里是所有的watcher并行会产生死锁先改成串行后续再优化
*/
await execOne(w, start);
}
const duration = Date.now() - start;
console.log(`${count}次执行watchers共执行${watchers.length}个,耗时${duration}毫秒`);

View File

@ -24,7 +24,7 @@
"oak-db": "file:../oak-db",
"oak-domain": "file:../oak-domain",
"oak-frontend-base": "file:../oak-frontend-base",
"socket.io": "^4.7.2",
"socket.io": "^4.8.1",
"socket.io-client": "^4.7.2",
"uuid": "^8.3.2"
},

View File

@ -448,7 +448,10 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
count++;
const start = Date.now();
for (const w of totalWatchers) {
execOne(w, start);
/**
* todo watcher并行
*/
await execOne(w, start);
}
const duration = Date.now() - start;
console.log(`${count}次执行watchers共执行${watchers.length}个,耗时${duration}毫秒`);