MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / getInternal

Method getInternal

lib/cache/multi.ts:51–68  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

49 }
50
51 override async getInternal(key: string): Promise<GetResult> {
52 const misses: BaseCache[] = [];
53
54 for (const cache of this.upstream) {
55 const result = await cache.get(key);
56
57 if (result.hit) {
58 await this.propagateHitToMissedCaches(misses, key, unwrap(result.data));
59 return result;
60 }
61
62 // keep track of caches that missed so we can write to them if we do hit
63 misses.push(cache);
64 }
65
66 // all caches missed
67 return {hit: false};
68 }
69
70 async putInternal(object: string, value: Buffer, creator?: string): Promise<void> {
71 await Promise.all(this.upstream.map(cache => cache.put(object, value, creator)));

Callers

nothing calls this directly

Calls 4

pushMethod · 0.80
getMethod · 0.65
unwrapFunction · 0.50

Tested by

no test coverage detected