MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / cacheGet

Method cacheGet

lib/compilation-env.ts:138–145  ·  view source on GitHub ↗
(object: CacheableValue)

Source from the content-addressed store, hash-verified

136 }
137
138 async cacheGet(object: CacheableValue) {
139 const result = await this.cache.get(BaseCache.hash(object));
140 if (this.cache.gets % this.reportCacheEvery === 0) {
141 this.cache.report();
142 }
143 if (!result.hit) return null;
144 return JSON.parse(unwrap(result.data).toString());
145 }
146
147 async cachePut(object: CacheableValue, result: object, creator: string | undefined) {
148 const key = BaseCache.hash(object);

Callers 3

handleExecutionMethod · 0.80
compileMethod · 0.80

Calls 5

reportMethod · 0.80
toStringMethod · 0.80
unwrapFunction · 0.70
getMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected