* Close all cached project connections
()
| 2742 | * Close all cached project connections |
| 2743 | */ |
| 2744 | closeAll(): Promise<void> { |
| 2745 | this.closing = true; |
| 2746 | this.worktreeMismatchCache.clear(); |
| 2747 | if (this.idleReleaseTimer) clearTimeout(this.idleReleaseTimer); |
| 2748 | this.idleReleaseTimer = null; |
| 2749 | this.nestedRepoCache.clear(); |
| 2750 | this.trimProjects(); |
| 2751 | if (this.projectCache.size === 0 && this.activeCalls === 0 && this.pendingCloses === 0) return Promise.resolve(); |
| 2752 | return new Promise((resolve) => this.closeWaiters.push(resolve)); |
| 2753 | } |
| 2754 | |
| 2755 | /** |
| 2756 | * Validate that a value is a non-empty string within length bounds. |