MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / loadCache

Function loadCache

tests/snippet-validation.test.cjs:70–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69// Cache management utilities
70function loadCache() {
71 if (clearCache) {
72 log('Clearing cache...', 'info');
73 if (fs.existsSync(CACHE_FILE)) {
74 fs.unlinkSync(CACHE_FILE);
75 }
76 return {};
77 }
78
79 if (fs.existsSync(CACHE_FILE)) {
80 try {
81 return JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'));
82 } catch (error) {
83 log(`Warning: Failed to load cache: ${error.message}`, 'warning');
84 return {};
85 }
86 }
87 return {};
88}
89
90function saveCache(cache) {
91 try {

Callers 1

runTestsFunction · 0.85

Calls 1

logFunction · 0.70

Tested by

no test coverage detected