(taskUuid)
| 1256 | } |
| 1257 | |
| 1258 | function scheduleWebSocketReconnect(taskUuid) { |
| 1259 | if (!taskUuid || wsReconnectTimer || wsManualClose || taskCompleted || taskFinalStatus !== null || activeTaskUuid !== taskUuid) { |
| 1260 | return; |
| 1261 | } |
| 1262 | |
| 1263 | wsReconnectAttempts += 1; |
| 1264 | const delay = getReconnectDelay(wsReconnectAttempts); |
| 1265 | addLog('warning', `[系统] WebSocket 已断开,${delay / 1000} 秒后尝试重连任务监控...`); |
| 1266 | |
| 1267 | wsReconnectTimer = setTimeout(() => { |
| 1268 | wsReconnectTimer = null; |
| 1269 | connectWebSocket(taskUuid); |
| 1270 | }, delay); |
| 1271 | } |
| 1272 | |
| 1273 | function scheduleBatchWebSocketReconnect(batchId) { |
| 1274 | if (!batchId || batchWsReconnectTimer || batchWsManualClose || batchCompleted || batchFinalStatus !== null || activeBatchId !== batchId) { |
no test coverage detected