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

Method startRecursive

src/sync/watcher.ts:436–452  ·  view source on GitHub ↗

* macOS/Windows: one recursive watcher for the whole tree. O(1) descriptors. * `filename` arrives relative to the project root (with subdirectories), so * it maps straight to a project-relative path.

()

Source from the content-addressed store, hash-verified

434 * it maps straight to a project-relative path.
435 */
436 private startRecursive(): void {
437 this.recursiveWatcher = watchImpl(
438 this.projectRoot,
439 { recursive: true, persistent: true },
440 (_event, filename) => {
441 if (this.stopped || filename == null) return;
442 this.handleChange(normalizePath(String(filename)));
443 }
444 );
445 this.recursiveWatcher.on('error', (err: unknown) => {
446 if (isWatchResourceExhaustion(err)) {
447 this.degrade(EXHAUSTION_REASON, { error: String(err) });
448 return;
449 }
450 logWarn('File watcher error', { error: String(err) });
451 });
452 }
453
454 /**
455 * Linux: walk the (non-ignored) tree and watch each directory. One inotify

Callers 1

startMethod · 0.95

Calls 6

handleChangeMethod · 0.95
degradeMethod · 0.95
normalizePathFunction · 0.90
logWarnFunction · 0.90
onMethod · 0.65

Tested by

no test coverage detected