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

Function getCachedRobotsTxt

src/api/utils/cache.ts:176–188  ·  view source on GitHub ↗
(
  domain: string,
  env: Env,
)

Source from the content-addressed store, hash-verified

174 * @returns Array of robot rules if found in cache, null otherwise
175 */
176export async function getCachedRobotsTxt(
177 domain: string,
178 env: Env,
179): Promise<RobotsRule[] | null> {
180 try {
181 const key = getRobotsTxtCacheKey(domain);
182 const result = await getFromCache(key, env);
183 return result as RobotsRule[] | null;
184 } catch (error) {
185 console.warn("Failed to retrieve robots.txt from cache:", error);
186 return null;
187 }
188}
189
190/**
191 * Cache robots.txt rules for a domain

Callers 1

checkRobotsTxtFunction · 0.85

Calls 3

getRobotsTxtCacheKeyFunction · 0.85
getFromCacheFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected