MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / proxy

Method proxy

aura/cache.py:332–350  ·  view source on GitHub ↗
(cls, *, src: Path, cache_id=None, tags=None)

Source from the content-addressed store, hash-verified

330
331 @classmethod
332 def proxy(cls, *, src: Path, cache_id=None, tags=None) -> Path:
333 if cls.get_location() is None: # Caching is disabled
334 return src
335
336 cache_obj = cls(src=src, cache_id=cache_id, tags=tags)
337
338 if cache_obj.is_valid:
339 logger.debug(f"Retrieving mirror file path {cache_obj.cid} from cache")
340 return cache_obj.cache_file_location
341
342 if not src.exists():
343 return src
344
345 try:
346 cache_obj.fetch()
347 return cache_obj.cache_file_location
348 except Exception as exc:
349 cache_obj.delete()
350 raise exc
351
352 @property
353 def metadata(self) -> dict:

Callers

nothing calls this directly

Calls 4

get_locationMethod · 0.80
existsMethod · 0.45
fetchMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected