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

Function cacheFilePath

src/api/utils/cache.ts:142–159  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  filename: string,
  path: string,
  branch: string,
  env: Env,
)

Source from the content-addressed store, hash-verified

140 * @param env - Environment with Cloudflare bindings
141 */
142export async function cacheFilePath(
143 owner: string,
144 repo: string,
145 filename: string,
146 path: string,
147 branch: string,
148 env: Env,
149): Promise<void> {
150 try {
151 const key = getRepoFilePathCacheKey(owner, repo);
152 await setInCache(key, { path, branch }, env, getCacheTTL());
153 console.log(
154 `Cached file path for ${filename} in ${owner}/${repo}: ${path}`,
155 );
156 } catch (error) {
157 console.warn("Failed to save to cache:", error);
158 }
159}
160
161/**
162 * Cache key structure for robots.txt content

Callers 1

searchGitHubRepoFunction · 0.85

Calls 5

getRepoFilePathCacheKeyFunction · 0.85
setInCacheFunction · 0.85
getCacheTTLFunction · 0.85
logMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected