From d0d2f5706622a8d14872b6ba16f90dbe74b46a76 Mon Sep 17 00:00:00 2001 From: saopig1 Date: Mon, 30 Mar 2026 21:33:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=9D=9E=E9=98=BB=E5=A1=9E=E5=B9=B6=E8=A1=8C?= =?UTF-8?q?=20=E2=80=94=20=E4=B8=80=E4=B8=AAbot=E8=BF=9E=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E4=B8=8D=E5=BD=B1=E5=93=8D=E5=85=B6=E4=BB=96bot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前 loadSavedBots 用 await 顺序连接所有bot,一个超时会阻塞 后续所有bot和web server启动。改为 .then()/.catch() 并行连接, 每个bot独立成败互不影响。 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/bot/manager.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bot/manager.ts b/src/bot/manager.ts index 9488a88..4dab98a 100644 --- a/src/bot/manager.ts +++ b/src/bot/manager.ts @@ -163,19 +163,18 @@ export class BotManager { this.bots.set(saved.id, bot); - // Auto-connect all saved bots on startup - try { - await bot.connect(); + // Auto-connect in background (non-blocking, won't affect other bots) + bot.connect().then(() => { this.logger.info( { botId: saved.id, name: saved.name }, "Auto-connected saved bot" ); - } catch (err) { + }).catch((err) => { this.logger.error( { err, botId: saved.id, name: saved.name }, - "Failed to auto-connect bot (will retry on manual start)" + "Failed to auto-connect bot (start manually from Settings)" ); - } + }); } this.logger.info(