* Permanently disable live watching after a terminal runtime failure * (watch-resource exhaustion, lock contention past the retry budget, or a * persistent generic sync failure past the retry budget). * Idempotent: logs one actionable warning, fires WatchOptions.onDegraded * once
(reason: string, context: Record<string, unknown> = {})
| 667 | * once, and stops the watcher. A subsequent start() clears the latch. |
| 668 | */ |
| 669 | private degrade(reason: string, context: Record<string, unknown> = {}): void { |
| 670 | if (this.degradedReason) return; |
| 671 | this.degradedReason = reason; |
| 672 | logWarn('File watcher disabled', { projectRoot: this.projectRoot, reason, ...context }); |
| 673 | this.onDegraded?.(reason); |
| 674 | this.stop(); |
| 675 | } |
| 676 | |
| 677 | /** |
| 678 | * Warn ONCE that the Linux inotify watch budget is exhausted (ENOSPC), and |