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