MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / startBatchPolling

Function startBatchPolling

static/js/app.js:1628–1660  ·  view source on GitHub ↗
(batchId)

Source from the content-addressed store, hash-verified

1626
1627// 开始轮询批量状态
1628function startBatchPolling(batchId) {
1629 if (batchPollingInterval) {
1630 return;
1631 }
1632
1633 batchPollingInterval = setInterval(async () => {
1634 try {
1635 const data = await api.get(`/registration/batch/${batchId}`);
1636 updateBatchProgress(data);
1637
1638 // 检查是否完成
1639 if (data.finished) {
1640 stopBatchPolling();
1641 resetButtons();
1642
1643 // 只显示一次 toast
1644 if (!toastShown) {
1645 toastShown = true;
1646 addLog('info', `[完成] 批量任务完成!成功: ${data.success}, 失败: ${data.failed}`);
1647 if (data.success > 0) {
1648 toast.success(`批量注册完成,成功 ${data.success} 个`);
1649 // 刷新账号列表
1650 loadRecentAccounts();
1651 } else {
1652 toast.warning('批量注册完成,但没有成功注册任何账号');
1653 }
1654 }
1655 }
1656 } catch (error) {
1657 console.error('轮询批量状态失败:', error);
1658 }
1659 }, 2000);
1660}
1661
1662// 停止轮询批量状态
1663function stopBatchPolling() {

Callers 1

startCurrentBatchPollingFunction · 0.85

Calls 9

updateBatchProgressFunction · 0.85
stopBatchPollingFunction · 0.85
resetButtonsFunction · 0.85
addLogFunction · 0.85
loadRecentAccountsFunction · 0.85
successMethod · 0.80
warningMethod · 0.80
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected