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

Method startWatching

src/mcp/engine.ts:452–461  ·  view source on GitHub ↗

* Start file watching on the active CodeGraph instance. Idempotent — the * watcher is per-engine, not per-session, which is why the daemon path * collapses N inotify sets to one. The wording of the disabled-reason log * exactly matches the prior in-tree implementation so log-driven dashboar

()

Source from the content-addressed store, hash-verified

450 * keep working.
451 */
452 private startWatching(): void {
453 if (this.opts.readOnly || !this.cg || this.watcherStarted || !this.opts.watch) return;
454
455 const opened = this.cg;
456 this.defaultLease = acquireProject(opened.getProjectRoot(), () => opened, this.watchOptions());
457 this.cg = this.defaultLease.cg;
458 if (this.cg !== opened) opened.close();
459 this.toolHandler.setDefaultCodeGraph(this.cg);
460 this.watcherStarted = true;
461 }
462
463 /**
464 * Reconcile the index with the current filesystem once, right after open —

Callers 2

retryInitializeSyncMethod · 0.95
doInitializeMethod · 0.95

Calls 5

watchOptionsMethod · 0.95
acquireProjectFunction · 0.90
setDefaultCodeGraphMethod · 0.80
getProjectRootMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected