MCPcopy
hub / github.com/colbymchenry/codegraph / startRecursive

Method startRecursive

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

396 * it maps straight to a project-relative path.
397 */
398 private startRecursive(): void {
399 this.recursiveWatcher = watchImpl(
400 this.projectRoot,
401 { recursive: true, persistent: true },
402 (_event, filename) => {
403 if (this.stopped || filename == null) return;
404 this.handleChange(normalizePath(String(filename)));
405 }
406 );
407 this.recursiveWatcher.on('error', (err: unknown) => {
408 if (isWatchResourceExhaustion(err)) {
409 this.degrade(EXHAUSTION_REASON, { error: String(err) });
410 return;
411 }
412 logWarn('File watcher error', { error: String(err) });
413 });
414 }
415
416 /**
417 * 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