From 9d1b61e69a4831209453369612dc64ca06be8a10 Mon Sep 17 00:00:00 2001 From: Xc Date: Thu, 8 May 2025 13:21:21 +0800 Subject: [PATCH] =?UTF-8?q?cluster=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=AF=B9sub?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ClusterAppLoader.js | 5 +++-- src/ClusterAppLoader.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ClusterAppLoader.js b/lib/ClusterAppLoader.js index bbb1f62..707839b 100644 --- a/lib/ClusterAppLoader.js +++ b/lib/ClusterAppLoader.js @@ -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); } } diff --git a/src/ClusterAppLoader.ts b/src/ClusterAppLoader.ts index 4cd427f..3b38112 100644 --- a/src/ClusterAppLoader.ts +++ b/src/ClusterAppLoader.ts @@ -138,8 +138,9 @@ export class ClusterAppLoader