()
| 152 | const DEFAULT_MAX_DIR_WATCHES = 50_000; |
| 153 | |
| 154 | function maxDirWatches(): number { |
| 155 | const raw = process.env.CODEGRAPH_MAX_DIR_WATCHES; |
| 156 | if (raw && /^\d+$/.test(raw)) { |
| 157 | const n = Number(raw); |
| 158 | if (n > 0) return n; |
| 159 | } |
| 160 | return DEFAULT_MAX_DIR_WATCHES; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Test seam (see {@link __emitWatchEventForTests}). Maps a watcher's project |