将Watcher改成串行,socket.io升级
This commit is contained in:
parent
6dcf718007
commit
3e489e7b9e
|
|
@ -371,7 +371,10 @@ class AppLoader extends types_1.AppLoader {
|
||||||
count++;
|
count++;
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
for (const w of totalWatchers) {
|
for (const w of totalWatchers) {
|
||||||
execOne(w, start);
|
/**
|
||||||
|
* todo 原来这里是所有的watcher并行,会产生死锁,先改成串行,后续再优化
|
||||||
|
*/
|
||||||
|
await execOne(w, start);
|
||||||
}
|
}
|
||||||
const duration = Date.now() - start;
|
const duration = Date.now() - start;
|
||||||
console.log(`第${count}次执行watchers,共执行${watchers.length}个,耗时${duration}毫秒`);
|
console.log(`第${count}次执行watchers,共执行${watchers.length}个,耗时${duration}毫秒`);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
"oak-db": "file:../oak-db",
|
"oak-db": "file:../oak-db",
|
||||||
"oak-domain": "file:../oak-domain",
|
"oak-domain": "file:../oak-domain",
|
||||||
"oak-frontend-base": "file:../oak-frontend-base",
|
"oak-frontend-base": "file:../oak-frontend-base",
|
||||||
"socket.io": "^4.7.2",
|
"socket.io": "^4.8.1",
|
||||||
"socket.io-client": "^4.7.2",
|
"socket.io-client": "^4.7.2",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,10 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
|
||||||
count++;
|
count++;
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
for (const w of totalWatchers) {
|
for (const w of totalWatchers) {
|
||||||
execOne(w, start);
|
/**
|
||||||
|
* todo 原来这里是所有的watcher并行,会产生死锁,先改成串行,后续再优化
|
||||||
|
*/
|
||||||
|
await execOne(w, start);
|
||||||
}
|
}
|
||||||
const duration = Date.now() - start;
|
const duration = Date.now() - start;
|
||||||
console.log(`第${count}次执行watchers,共执行${watchers.length}个,耗时${duration}毫秒`);
|
console.log(`第${count}次执行watchers,共执行${watchers.length}个,耗时${duration}毫秒`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue