* Begin polling the output file for progress. Called from React * useEffect when the progress component mounts.
(taskId: string)
| 81 | * useEffect when the progress component mounts. |
| 82 | */ |
| 83 | static startPolling(taskId: string): void { |
| 84 | const instance = TaskOutput.#registry.get(taskId) |
| 85 | if (!instance || !instance.#onProgress) { |
| 86 | return |
| 87 | } |
| 88 | TaskOutput.#activePolling.set(taskId, instance) |
| 89 | if (!TaskOutput.#pollInterval) { |
| 90 | TaskOutput.#pollInterval = setInterval(TaskOutput.#tick, POLL_INTERVAL_MS) |
| 91 | TaskOutput.#pollInterval.unref() |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Stop polling the output file. Called from React useEffect cleanup |
no test coverage detected