* 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)
| 1056 | * exponentially instead of hammering the lock every debounce cycle. |
| 1057 | */ |
| 1058 | private scheduleRetrySync(delayMs: number): void { |
| 1059 | if (this.debounceTimer) { |
| 1060 | clearTimeout(this.debounceTimer); |
| 1061 | } |
| 1062 | this.debounceTimer = setTimeout(() => { |
| 1063 | this.debounceTimer = null; |
| 1064 | this.flush(); |
| 1065 | }, delayMs); |
| 1066 | } |
| 1067 | |
| 1068 | /** |
| 1069 | * Flush pending changes by running sync. |