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