()
| 527 | } |
| 528 | |
| 529 | function startPolling() { |
| 530 | if (selfcheckState.pollTimer) { |
| 531 | clearInterval(selfcheckState.pollTimer); |
| 532 | } |
| 533 | selfcheckState.pollTimer = setInterval(async () => { |
| 534 | try { |
| 535 | await loadScheduleAndRuntime(); |
| 536 | const running = selfcheckState.runs.some((run) => ['running', 'pending'].includes(String(run.status || '').toLowerCase())); |
| 537 | if (running) { |
| 538 | await loadRuns(); |
| 539 | } |
| 540 | } catch (error) { |
| 541 | // 轮询静默失败,不打断页面交互 |
| 542 | } |
| 543 | }, 5000); |
| 544 | } |
| 545 | |
| 546 | async function initSelfcheckPage() { |
| 547 | bindEvents(); |
no test coverage detected