MCPcopy Index your code
hub / github.com/coder/coder / updateProgress

Function updateProgress

site/src/pages/WorkspacePage/WorkspaceBuildProgress.tsx:91–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 // biome-ignore lint/correctness/useExhaustiveDependencies: consider refactoring
90 useEffect(() => {
91 const updateProgress = () => {
92 if (
93 job === undefined ||
94 job.status !== "running" ||
95 transitionStats.P50 === undefined ||
96 transitionStats.P95 === undefined ||
97 transitionStats.P50 === null ||
98 transitionStats.P95 === null
99 ) {
100 setProgressValue(undefined);
101 setProgressText(undefined);
102 return;
103 }
104
105 const [est, text] = estimateFinish(
106 dayjs(job.started_at),
107 transitionStats.P50,
108 transitionStats.P95,
109 );
110 setProgressValue(est);
111 setProgressText(text);
112 };
113 const updateTimer = requestAnimationFrame(updateProgress);
114 return () => {
115 cancelAnimationFrame(updateTimer);

Callers

nothing calls this directly

Calls 1

estimateFinishFunction · 0.85

Tested by

no test coverage detected