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

Method startRecursive

src/sync/watcher.ts:438–454  ·  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

436 * it maps straight to a project-relative path.
437 */
438 private startRecursive(): void {
439 this.recursiveWatcher = watchImpl(
440 this.projectRoot,
441 { recursive: true, persistent: true },
442 (_event, filename) => {
443 if (this.stopped || filename == null) return;
444 this.handleChange(normalizePath(String(filename)));
445 }
446 );
447 this.recursiveWatcher.on('error', (err: unknown) => {
448 if (isWatchResourceExhaustion(err)) {
449 this.degrade(EXHAUSTION_REASON, { error: String(err) });
450 return;
451 }
452 logWarn('File watcher error', { error: String(err) });
453 });
454 }
455
456 /**
457 * 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