MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / worker

Function worker

graph-ui/src/system/IndexesPanel.tsx:72–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 const rows = new Array<IndexReading>(projects.length);
71 let cursor = 0;
72 const worker = async () => {
73 while (cursor < projects.length) {
74 if (!enabled.current || document.visibilityState === 'hidden') throw new Error('Index reading paused.');
75 const index = cursor++;
76 const project = projects[index];
77 try {
78 if (!api.projectHealth) throw new Error('Project health is unavailable.');
79 rows[index] = { project, health: await api.projectHealth(project.name), error: null };
80 } catch (error) {
81 rows[index] = { project, health: previous.current.get(project.name)?.health ?? null, error: failureText(error) };
82 }
83 }
84 };
85 const work = await Promise.allSettled(Array.from({ length: Math.min(4, projects.length) }, worker));
86 const failed = work.find(result => result.status === 'rejected');
87 if (failed?.status === 'rejected') throw failed.reason;

Callers

nothing calls this directly

Calls 3

failureTextFunction · 0.85
projectHealthMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected