MCPcopy Create free account
hub / github.com/SurceBeats/Atlas / clear_cache

Function clear_cache

pymodules/__atlas_cache_daemon.py:12–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def clear_cache():
13 while True:
14 now = time.time()
15
16 for filename in os.listdir(cache_dir):
17 filepath = os.path.join(cache_dir, filename)
18 if os.path.isfile(filepath):
19 file_creation_time = os.path.getctime(filepath)
20
21 if config.cache_cleanup_time is None:
22 raise ValueError("cache_cleanup_time is not initialized properly.")
23
24 if now - file_creation_time > config.cache_cleanup_time:
25 os.remove(filepath)
26 time.sleep(60)
27
28
29def start_cache_daemon():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected