MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / rebuildNameSegmentVocab

Method rebuildNameSegmentVocab

src/index.ts:1455–1464  ·  view source on GitHub ↗

* Rebuild the segment vocabulary from the current graph, batched and * yielding — the upgrade-heal path for indexes built before the vocab table * existed. Runs inside the index mutex/lock (sync and * healSegmentVocabIfEmpty hold them).

()

Source from the content-addressed store, hash-verified

1453 * healSegmentVocabIfEmpty hold them).
1454 */
1455 private async rebuildNameSegmentVocab(): Promise<void> {
1456 const maybeYield = createYielder();
1457 const BATCH = 2000;
1458 for (let offset = 0; ; offset += BATCH) {
1459 const names = this.queries.getDistinctNodeNames(BATCH, offset);
1460 if (names.length === 0) break;
1461 this.queries.insertNameSegmentsBatch(names);
1462 await maybeYield();
1463 }
1464 }
1465
1466 /**
1467 * Normalized project-name tokens (go.mod / package.json / repo dir) used to

Callers 2

syncMethod · 0.95

Calls 3

createYielderFunction · 0.90
getDistinctNodeNamesMethod · 0.80

Tested by

no test coverage detected