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

Method degrade

src/sync/watcher.ts:597–603  ·  view source on GitHub ↗

* Permanently disable live watching after a terminal runtime failure * (watch-resource exhaustion, or lock contention past the retry budget). * Idempotent: logs one actionable warning, fires WatchOptions.onDegraded * once, and stops the watcher. A subsequent start() clears the latch

(reason: string, context: Record<string, unknown> = {})

Source from the content-addressed store, hash-verified

595 * once, and stops the watcher. A subsequent start() clears the latch.
596 */
597 private degrade(reason: string, context: Record<string, unknown> = {}): void {
598 if (this.degradedReason) return;
599 this.degradedReason = reason;
600 logWarn('File watcher disabled', { projectRoot: this.projectRoot, reason, ...context });
601 this.onDegraded?.(reason);
602 this.stop();
603 }
604
605 /**
606 * Warn ONCE that the Linux inotify watch budget is exhausted (ENOSPC), and

Callers 4

startMethod · 0.95
startRecursiveMethod · 0.95
watchTreeMethod · 0.95
flushMethod · 0.95

Calls 2

stopMethod · 0.95
logWarnFunction · 0.90

Tested by

no test coverage detected