()
| 69 | let scanning = false; |
| 70 | |
| 71 | function schedule() { |
| 72 | if (pending) return; |
| 73 | pending = setTimeout(async () => { |
| 74 | pending = null; |
| 75 | if (scanning) { schedule(); return; } |
| 76 | scanning = true; |
| 77 | try { await runScan(); } finally { scanning = false; } |
| 78 | }, opts.debounce); |
| 79 | } |
| 80 | |
| 81 | console.log(`[local-watch] root: ${ROOT}`); |
| 82 | console.log(`[local-watch] debounce: ${opts.debounce}ms intake: ${opts.intake}`); |