修复:AI问答模块
This commit is contained in:
@@ -97,10 +97,16 @@ export class WebSocketManager {
|
||||
setTimeout(() => {
|
||||
this.connect().catch(error => {
|
||||
console.error('重连失败:', error);
|
||||
// 继续尝试重连
|
||||
this.handleReconnect();
|
||||
});
|
||||
}, this.reconnectInterval);
|
||||
}, this.reconnectInterval * this.reconnectAttempts); // 递增重连间隔
|
||||
} else {
|
||||
console.error('WebSocket重连次数已达上限');
|
||||
// 重置重连次数,以便后续手动重连
|
||||
setTimeout(() => {
|
||||
this.reconnectAttempts = 0;
|
||||
}, 60000); // 1分钟后重置
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user