fix: address Phase 6 review — error handling on player routes, SPA fallback scope, WS cleanup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.6 committed 2026-03-30 00:49:34 +08:00
1 parent 0b54809113
commit 2a966e914c
3 files changed
+51 -58

No files matched your search

+6 -2
View File
@@ -6,7 +6,7 @@ export function setupWebSocket(
wss: WebSocketServer,
botManager: BotManager,
logger: Logger
): void {
): () => void {
const clients = new Set<WebSocket>();
wss.on("connection", (ws) => {
@@ -65,6 +65,10 @@ export function setupWebSocket(
}
};
setInterval(attachBotListeners, 5000);
const intervalId = setInterval(attachBotListeners, 5000);
attachBotListeners();
return () => {
clearInterval(intervalId);
};
}