* 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> = {})
| 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 |