* 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)
| 731 | * exponentially instead of hammering the lock every debounce cycle. |
| 732 | */ |
| 733 | private scheduleRetrySync(delayMs: number): void { |
| 734 | if (this.debounceTimer) { |
| 735 | clearTimeout(this.debounceTimer); |
| 736 | } |
| 737 | this.debounceTimer = setTimeout(() => { |
| 738 | this.debounceTimer = null; |
| 739 | this.flush(); |
| 740 | }, delayMs); |
| 741 | } |
| 742 | |
| 743 | /** |
| 744 | * Flush pending changes by running sync. |