mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-05-06 20:02:51 +08:00
fix: route batch websocket fallback by task type
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user