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

Method getInternal

lib/cache/on-disk.ts:103–114  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

101 }
102
103 override async getInternal(key: string): Promise<GetResult> {
104 const cached = this.cache.get(key);
105 if (!cached) return {hit: false};
106
107 try {
108 const data = await fs.promises.readFile(cached.path);
109 return {hit: true, data: data};
110 } catch (err) {
111 logger.error(`error reading '${key}' from disk cache: `, err);
112 return {hit: false};
113 }
114 }
115
116 async putInternal(key: string, value: Buffer): Promise<void> {
117 const info = {

Callers

nothing calls this directly

Calls 3

readFileMethod · 0.80
errorMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected