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

Method indexFiles

src/index.ts:722–735  ·  view source on GitHub ↗

* Index specific files * * Uses a mutex to prevent concurrent indexing operations.

(filePaths: string[])

Source from the content-addressed store, hash-verified

720 * Uses a mutex to prevent concurrent indexing operations.
721 */
722 async indexFiles(filePaths: string[]): Promise<IndexResult> {
723 return this.indexMutex.withLock(async () => {
724 try {
725 this.fileLock.acquire();
726 } catch {
727 return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' as const }], durationMs: 0 };
728 }
729 try {
730 return this.orchestrator.indexFiles(filePaths);
731 } finally {
732 this.fileLock.release();
733 }
734 });
735 }
736
737 /**
738 * Sync with current file state (incremental update)

Callers 2

interruptAfterExtractionFunction · 0.45
extraction.test.tsFile · 0.45

Calls 3

releaseMethod · 0.80
withLockMethod · 0.45
acquireMethod · 0.45

Tested by 1

interruptAfterExtractionFunction · 0.36