* Debounced push: waits for writes to settle, then pushes once.
()
| 130 | * Debounced push: waits for writes to settle, then pushes once. |
| 131 | */ |
| 132 | function schedulePush(): void { |
| 133 | if (pushSuppressedReason !== null) return |
| 134 | hasPendingChanges = true |
| 135 | if (debounceTimer) { |
| 136 | clearTimeout(debounceTimer) |
| 137 | } |
| 138 | debounceTimer = setTimeout(() => { |
| 139 | if (pushInProgress) { |
| 140 | schedulePush() |
| 141 | return |
| 142 | } |
| 143 | currentPushPromise = executePush() |
| 144 | }, DEBOUNCE_MS) |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * Start watching the team memory directory for changes. |
no test coverage detected