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

Function get

lib/cache/base.ts:85–93  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

83 }
84
85 async get(key: string): Promise<GetResult> {
86 this.gets++;
87 const result = await this.getInternal(key);
88 if (result.hit) this.hits++;
89 const resultTypeName = result.hit ? 'hit' : 'miss';
90 logger.debug(`Cache ${this.cacheName}: get ${key} ${resultTypeName}`);
91 if (this.countersEnabled) GetCounter.inc({type: this.type, name: this.cacheName, result: resultTypeName});
92 return result;
93 }
94
95 async put(key: string, value: any, creator?: string): Promise<void> {
96 if (!(value instanceof Buffer)) value = Buffer.from(value);

Callers

nothing calls this directly

Calls 1

getInternalMethod · 0.45

Tested by

no test coverage detected