(options: CacheOptions = {})
| 17 | private cleanupInterval: number; |
| 18 | |
| 19 | constructor(options: CacheOptions = {}) { |
| 20 | this.cache = new Map(); |
| 21 | this.maxSize = options.maxSize || 500; |
| 22 | this.ttl = options.ttl || 60 * 60 * 1000; // 1 hour default |
| 23 | this.cleanupInterval = options.cleanupInterval || 5 * 60 * 1000; // 5 minutes default |
| 24 | this.cleanupTimer = null; |
| 25 | this.startCleanupTimer(); |
| 26 | } |
| 27 | |
| 28 | private startCleanupTimer(): void { |
| 29 | if (this.cleanupTimer) { |
nothing calls this directly
no test coverage detected