MCPcopy Create free account
hub / github.com/idosal/git-mcp / cacheFetchDocResult

Function cacheFetchDocResult

src/api/utils/cache.ts:331–347  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  result: FetchDocumentationResult,
  ttl: number,
  env: Env,
)

Source from the content-addressed store, hash-verified

329 * @param env - Environment with Cloudflare bindings
330 */
331export async function cacheFetchDocResult(
332 owner: string,
333 repo: string,
334 result: FetchDocumentationResult,
335 ttl: number,
336 env: Env,
337): Promise<void> {
338 try {
339 const key = getFetchDocCacheKey(owner, repo);
340 await setInCache(key, result, env, ttl);
341 console.log(
342 `Cached fetchDocumentation result for ${owner}/${repo} with TTL ${ttl}s`,
343 );
344 } catch (error) {
345 console.warn("Failed to save fetchDoc result to cache:", error);
346 }
347}
348
349// 12h matches the KV cache TTL used elsewhere
350const AUTORAG_CACHE_TTL = 60 * 60 * 12;

Callers 1

fetchDocumentationFunction · 0.85

Calls 4

getFetchDocCacheKeyFunction · 0.85
setInCacheFunction · 0.85
logMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected