mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
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:
1 parent
0b54809113
commit
2a966e914c
3 files changed
+51
-58
No files matched your search
@@ -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);
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user