From 22ef776b2709ab7f589cfc37bf411f9ff08e53d6 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Tue, 24 Feb 2026 23:53:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=99=90=E5=88=B6=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=9C=80=E5=A4=A7=E9=87=8D=E8=BF=9E=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E4=B8=BA=2050=EF=BC=8C=E5=A2=9E=E5=BC=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=A5=E5=BF=97=E4=BF=A1=E6=81=AF=EF=BC=9B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20cnb-board=20=E8=B7=AF=E7=94=B1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/module/assistant/local-app-manager/assistant-app.ts | 4 ++-- assistant/src/module/remote-app/remote-app.ts | 2 +- assistant/src/routes/cnb-board/cnb-dev-env.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assistant/src/module/assistant/local-app-manager/assistant-app.ts b/assistant/src/module/assistant/local-app-manager/assistant-app.ts index 4ffbd87..d4400f0 100644 --- a/assistant/src/module/assistant/local-app-manager/assistant-app.ts +++ b/assistant/src/module/assistant/local-app-manager/assistant-app.ts @@ -139,7 +139,7 @@ export class AssistantApp extends Manager { // 使用 RemoteApp 内置的自动重连机制 autoReconnect: true, reconnectDelay: 5000, // 首次重连延迟 5 秒 - maxReconnectAttempts: Infinity, // 无限重连 + maxReconnectAttempts: 50, // 最大重连次数 enableBackoff: true, // 启用指数退避 }); remoteApp.isConnect(); @@ -161,7 +161,7 @@ export class AssistantApp extends Manager { logger.info('[remote-app] 远程连接已关闭,自动重连机制正在处理...'); }); remoteApp.on('maxReconnectAttemptsReached', () => { - logger.error('远程应用重连达到最大次数,停止重连'); + logger.error('[remote-app] 远程应用重连达到最大次数,停止重连'); }); this.remoteApp = remoteApp; } else { diff --git a/assistant/src/module/remote-app/remote-app.ts b/assistant/src/module/remote-app/remote-app.ts index b640a55..af60dc0 100644 --- a/assistant/src/module/remote-app/remote-app.ts +++ b/assistant/src/module/remote-app/remote-app.ts @@ -207,7 +207,7 @@ export class RemoteApp { this.emitter.emit('message', data); } onError(error: any) { - console.error('远程应用错误:', this.id, error); + console.error(`[remote-app] 远程应用错误: ${this.id}`, error); this.isError = true; this.emitter.emit('error', error); } diff --git a/assistant/src/routes/cnb-board/cnb-dev-env.ts b/assistant/src/routes/cnb-board/cnb-dev-env.ts index 8f9c010..1617706 100644 --- a/assistant/src/routes/cnb-board/cnb-dev-env.ts +++ b/assistant/src/routes/cnb-board/cnb-dev-env.ts @@ -25,8 +25,8 @@ app.route({ } }).define(async (ctx) => { const more = ctx.query?.more ?? false - const list = getLiveMdContent({ more: more }); if (notCNBCheck(ctx)) return; + const list = getLiveMdContent({ more: more }); ctx.body = { title: '开发环境模式配置', list,