* Index specific files * * Uses a mutex to prevent concurrent indexing operations.
(filePaths: string[])
| 519 | * Uses a mutex to prevent concurrent indexing operations. |
| 520 | */ |
| 521 | async indexFiles(filePaths: string[]): Promise<IndexResult> { |
| 522 | return this.indexMutex.withLock(async () => { |
| 523 | try { |
| 524 | this.fileLock.acquire(); |
| 525 | } catch { |
| 526 | 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 }; |
| 527 | } |
| 528 | try { |
| 529 | return this.orchestrator.indexFiles(filePaths); |
| 530 | } finally { |
| 531 | this.fileLock.release(); |
| 532 | } |
| 533 | }); |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * Sync with current file state (incremental update) |
no test coverage detected