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

Method indexFiles

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

755 * Uses a mutex to prevent concurrent indexing operations.
756 */
757 async indexFiles(filePaths: string[]): Promise<IndexResult> {
758 return this.indexMutex.withLock(async () => {
759 try {
760 this.fileLock.acquire();
761 } catch {
762 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 };
763 }
764 try {
765 return this.orchestrator.indexFiles(filePaths);
766 } finally {
767 this.fileLock.release();
768 }
769 });
770 }
771
772 /**
773 * Sync with current file state (incremental update)

Calls 3

withLockMethod · 0.45
acquireMethod · 0.45
releaseMethod · 0.45

Tested by 1

interruptAfterExtractionFunction · 0.36