* Schedule a normal debounced sync after a source edit.
()
| 836 | * Schedule a normal debounced sync after a source edit. |
| 837 | */ |
| 838 | private scheduleSync(): void { |
| 839 | if (this.debounceTimer) { |
| 840 | clearTimeout(this.debounceTimer); |
| 841 | } |
| 842 | // Adaptive quiet window: a lone save (or a pair — editor + its test file) |
| 843 | // fires fast so the graph feels instant; anything bigger keeps the full |
| 844 | // configured window so an agent's multi-file burst still coalesces into |
| 845 | // one sync exactly as before. Re-arming on each event preserves the |
| 846 | // trailing-edge semantics either way: if more events arrive inside the |
| 847 | // quick window, the reschedule sees the larger pending set and extends to |
| 848 | // the full window. Never exceeds the configured debounce (a user-lowered |
| 849 | // CODEGRAPH_WATCH_DEBOUNCE_MS stays authoritative), floor 100ms. |
| 850 | const quickMs = Math.max(100, Math.min(QUICK_SYNC_QUIET_MS, this.debounceMs)); |
| 851 | const delay = this.pendingFiles.size <= QUICK_SYNC_MAX_PENDING ? quickMs : this.debounceMs; |
| 852 | this.debounceTimer = setTimeout(() => { |
| 853 | this.debounceTimer = null; |
| 854 | this.flush(); |
| 855 | }, delay); |
| 856 | } |
| 857 | |
| 858 | /** |
| 859 | * Schedule a retry after a recoverable sync failure (lock contention). Kept |
no test coverage detected