MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / cleanup

Method cleanup

aura/cache.py:90–109  ·  view source on GitHub ↗
(cls, items: Optional[Iterable[CacheItem]]=None)

Source from the content-addressed store, hash-verified

88
89 @classmethod
90 def cleanup(cls, items: Optional[Iterable[CacheItem]]=None):
91 cache_loc = Cache.get_location()
92 if cache_loc is None:
93 return
94
95 total, used, free = shutil.disk_usage(cache_loc)
96 remaining = used
97 threshold = get_cache_threshold()
98
99 if items is None:
100 items = cls.analyze()
101
102 for x in items: # type: CacheItem
103 if x.is_expired:
104 pass
105 elif remaining < threshold:
106 continue
107
108 remaining -= x.size
109 x.delete()
110
111
112class Cache(ABC):

Callers 11

test_cache_purgeFunction · 0.45
test_url_cachingFunction · 0.45
test_pypi_cacheFunction · 0.45
test_ast_cacheFunction · 0.45
cleanupFunction · 0.45
check_requirementFunction · 0.45
scan_uriFunction · 0.45
cleanupFunction · 0.45
purgeFunction · 0.45

Calls 4

get_cache_thresholdFunction · 0.85
get_locationMethod · 0.80
analyzeMethod · 0.45
deleteMethod · 0.45

Tested by 6

test_cache_purgeFunction · 0.36
test_url_cachingFunction · 0.36
test_pypi_cacheFunction · 0.36
test_ast_cacheFunction · 0.36