| 247 | private readonly ageTable: Promise<Table>; |
| 248 | |
| 249 | constructor( |
| 250 | private scope: ServiceWorkerGlobalScope, |
| 251 | private adapter: Adapter, |
| 252 | private config: DataGroupConfig, |
| 253 | private db: Database, |
| 254 | private debugHandler: DebugHandler, |
| 255 | cacheNamePrefix: string, |
| 256 | ) { |
| 257 | this.patterns = config.patterns.map((pattern) => new RegExp(pattern)); |
| 258 | this.cache = adapter.caches.open(`${cacheNamePrefix}:${config.name}:cache`); |
| 259 | this.lruTable = this.db.open(`${cacheNamePrefix}:${config.name}:lru`, config.cacheQueryOptions); |
| 260 | this.ageTable = this.db.open(`${cacheNamePrefix}:${config.name}:age`, config.cacheQueryOptions); |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Lazily initialize/load the LRU chain. |