(key: string)
| 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); |
nothing calls this directly
no test coverage detected