cluster环境下对sub的判断有点问题
This commit is contained in:
parent
a58ef9107e
commit
9d1b61e69a
|
|
@ -126,8 +126,9 @@ class ClusterAppLoader extends AppLoader_1.AppLoader {
|
|||
(0, assert_1.default)(!(cs && singleton));
|
||||
if (when === 'commit') {
|
||||
(0, assert_1.default)(!this.commitTriggers[name], `命名为${name}的trigger出现了多次,请检查`);
|
||||
this.commitTriggers[name] = !!cs;
|
||||
if (cs || singleton && (0, env_1.getClusterInfo)().instanceId === 0) {
|
||||
const needSub = !!(cs || singleton && (0, env_1.getClusterInfo)().instanceId === 0);
|
||||
this.commitTriggers[name] = needSub;
|
||||
if (needSub) {
|
||||
this.sub(name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,8 +138,9 @@ export class ClusterAppLoader<ED extends EntityDict & BaseEntityDict, Cxt extend
|
|||
assert(!(cs && singleton));
|
||||
if (when === 'commit') {
|
||||
assert(!this.commitTriggers[name], `命名为${name}的trigger出现了多次,请检查`);
|
||||
this.commitTriggers[name] = !!cs;
|
||||
if (cs || singleton && getClusterInfo().instanceId === 0) {
|
||||
const needSub = !!(cs || singleton && getClusterInfo().instanceId === 0);
|
||||
this.commitTriggers[name] = needSub;
|
||||
if (needSub) {
|
||||
this.sub(name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue