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

Method rebuildNameSegmentVocab

src/index.ts:1454–1463  ·  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

1452 * healSegmentVocabIfEmpty hold them).
1453 */
1454 private async rebuildNameSegmentVocab(): Promise<void> {
1455 const maybeYield = createYielder();
1456 const BATCH = 2000;
1457 for (let offset = 0; ; offset += BATCH) {
1458 const names = this.queries.getDistinctNodeNames(BATCH, offset);
1459 if (names.length === 0) break;
1460 this.queries.insertNameSegmentsBatch(names);
1461 await maybeYield();
1462 }
1463 }
1464
1465 /**
1466 * 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