* Schedule a retry after a recoverable sync failure (lock contention). Kept * separate from scheduleSync so prolonged contention backs off * exponentially instead of hammering the lock every debounce cycle.
(delayMs: number)
| 814 | * exponentially instead of hammering the lock every debounce cycle. |
| 815 | */ |
| 816 | private scheduleRetrySync(delayMs: number): void { |
| 817 | if (this.debounceTimer) { |
| 818 | clearTimeout(this.debounceTimer); |
| 819 | } |
| 820 | this.debounceTimer = setTimeout(() => { |
| 821 | this.debounceTimer = null; |
| 822 | this.flush(); |
| 823 | }, delayMs); |
| 824 | } |
| 825 | |
| 826 | /** |
| 827 | * Flush pending changes by running sync. |