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

Method startWatching

src/mcp/engine.ts:482–491  ·  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

480 * keep working.
481 */
482 private startWatching(): void {
483 if (this.opts.readOnly || !this.cg || this.watcherStarted || !this.opts.watch) return;
484
485 const opened = this.cg;
486 this.defaultLease = acquireProject(opened.getProjectRoot(), () => opened, this.watchOptions());
487 this.cg = this.defaultLease.cg;
488 if (this.cg !== opened) opened.close();
489 this.toolHandler.setDefaultCodeGraph(this.cg);
490 this.watcherStarted = true;
491 }
492
493 /**
494 * 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