MCPcopy
hub / github.com/directus/directus / getProviderProject

Method getProviderProject

api/src/services/deployment.ts:336–356  ·  view source on GitHub ↗

* Get project details from provider with caching

(provider: ProviderType, projectId: string)

Source from the content-addressed store, hash-verified

334 * Get project details from provider with caching
335 */
336 async getProviderProject(provider: ProviderType, projectId: string): Promise<CachedResult<Project>> {
337 const cacheKey = `${provider}:project:${projectId}`;
338 const { deploymentCache } = getCache();
339
340 // Check cache first
341 const cached = await getCacheValueWithTTL(deploymentCache, cacheKey);
342
343 if (cached) {
344 return { data: cached.data, remainingTTL: cached.remainingTTL };
345 }
346
347 // Fetch from driver
348 const driver = await this.getDriver(provider);
349 const project = await driver.getProject(projectId);
350
351 // Store in cache
352 await setCacheValueWithExpiry(deploymentCache, cacheKey, project, DEPLOYMENT_CACHE_TTL);
353
354 // Return with full TTL (just cached)
355 return { data: project, remainingTTL: DEPLOYMENT_CACHE_TTL };
356 }
357
358 /**
359 * Dashboard: projects + latest run status + stats

Callers

nothing calls this directly

Calls 5

getDriverMethod · 0.95
getCacheValueWithTTLFunction · 0.85
setCacheValueWithExpiryFunction · 0.85
getCacheFunction · 0.50
getProjectMethod · 0.45

Tested by

no test coverage detected