(cacheName: string, cacheMb: number)
| 34 | private readonly cache: LRUCache<string, Buffer>; |
| 35 | |
| 36 | constructor(cacheName: string, cacheMb: number) { |
| 37 | super(cacheName, `InMemoryCache(${cacheMb}Mb)`, 'memory'); |
| 38 | this.cacheMb = cacheMb; |
| 39 | this.cache = new LRUCache({ |
| 40 | maxSize: cacheMb * 1024 * 1024, |
| 41 | sizeCalculation: n => n.length, |
| 42 | }); |
| 43 | } |
| 44 | |
| 45 | override statString(): string { |
| 46 | return `${super.statString()}, LRU has ${this.cache.size} item(s) totalling ${this.cache.calculatedSize} bytes`; |
nothing calls this directly
no outgoing calls
no test coverage detected