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

Method catchUpSync

src/mcp/engine.ts:343–359  ·  view source on GitHub ↗

* Reconcile the index with the current filesystem once, right after open — * catches edits, adds, deletes, and `git pull`/`checkout` changes made while * no watcher was running. Runs in the background, but the returned promise * is pushed into the ToolHandler as a one-shot gate so the *firs

()

Source from the content-addressed store, hash-verified

341 * is populated by the watcher, not by catch-up).
342 */
343 private catchUpSync(): void {
344 const cg = this.cg;
345 if (!cg) return;
346 const p = cg
347 .sync()
348 .then((result) => {
349 const changed = result.filesAdded + result.filesModified + result.filesRemoved;
350 if (changed > 0) {
351 process.stderr.write(`[CodeGraph MCP] Caught up ${changed} file(s) changed since last run\n`);
352 }
353 })
354 .catch((err) => {
355 const msg = err instanceof Error ? err.message : String(err);
356 process.stderr.write(`[CodeGraph MCP] Catch-up sync failed: ${msg}\n`);
357 });
358 this.toolHandler.setCatchUpGate(p);
359 }
360}
361
362/**

Callers 2

retryInitializeSyncMethod · 0.95
doInitializeMethod · 0.95

Calls 3

setCatchUpGateMethod · 0.80
writeMethod · 0.65
syncMethod · 0.45

Tested by

no test coverage detected