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,