fix: route batch websocket fallback by task type

This commit is contained in:
zhoukailian
2026-03-23 19:59:04 +08:00
committed by Mison
parent 5f9032fbf7
commit 9fdc7a882d
2 changed files with 145 additions and 3 deletions

View File

@@ -1306,7 +1306,7 @@ function connectBatchWebSocket(batchId) {
if (shouldPoll && currentBatch) {
console.log('切换到轮询模式');
startOutlookBatchPolling(currentBatch.batch_id);
startCurrentBatchPolling(currentBatch.batch_id);
}
};
@@ -1314,12 +1314,12 @@ function connectBatchWebSocket(batchId) {
console.error('批量任务 WebSocket 错误:', error);
stopBatchWebSocketHeartbeat();
// 切换到轮询
startOutlookBatchPolling(batchId);
startCurrentBatchPolling(batchId);
};
} catch (error) {
console.error('批量任务 WebSocket 连接失败:', error);
startOutlookBatchPolling(batchId);
startCurrentBatchPolling(batchId);
}
}
@@ -1332,6 +1332,15 @@ function disconnectBatchWebSocket() {
}
}
function startCurrentBatchPolling(batchId) {
if (isOutlookBatchMode) {
startOutlookBatchPolling(batchId);
return;
}
startBatchPolling(batchId);
}
// 开始批量任务心跳
function startBatchWebSocketHeartbeat() {
stopBatchWebSocketHeartbeat();