* List projects from provider with caching
(provider: ProviderType)
| 309 | * List projects from provider with caching |
| 310 | */ |
| 311 | async listProviderProjects(provider: ProviderType): Promise<CachedResult<Project[]>> { |
| 312 | const cacheKey = `${provider}:projects`; |
| 313 | const { deploymentCache } = getCache(); |
| 314 | |
| 315 | // Check cache first |
| 316 | const cached = await getCacheValueWithTTL(deploymentCache, cacheKey); |
| 317 | |
| 318 | if (cached) { |
| 319 | return { data: cached.data, remainingTTL: cached.remainingTTL }; |
| 320 | } |
| 321 | |
| 322 | // Fetch from driver |
| 323 | const driver = await this.getDriver(provider); |
| 324 | const projects = await driver.listProjects(); |
| 325 | |
| 326 | // Store in cache |
| 327 | await setCacheValueWithExpiry(deploymentCache, cacheKey, projects, DEPLOYMENT_CACHE_TTL); |
| 328 | |
| 329 | // Return with full TTL (just cached) |
| 330 | return { data: projects, remainingTTL: DEPLOYMENT_CACHE_TTL }; |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Get project details from provider with caching |
nothing calls this directly
no test coverage detected