* Sync the LRU chain to non-volatile storage.
()
| 279 | * Sync the LRU chain to non-volatile storage. |
| 280 | */ |
| 281 | async syncLru(): Promise<void> { |
| 282 | if (this._lru === null) { |
| 283 | return; |
| 284 | } |
| 285 | const table = await this.lruTable; |
| 286 | try { |
| 287 | return table.write('lru', this._lru!.state); |
| 288 | } catch (err) { |
| 289 | // Writing lru cache table failed. This could be a result of a full storage. |
| 290 | // Continue serving clients as usual. |
| 291 | this.debugHandler.log( |
| 292 | err as Error, |
| 293 | `DataGroup(${this.config.name}@${this.config.version}).syncLru()`, |
| 294 | ); |
| 295 | await this.detectStorageFull(); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | /** |
| 300 | * Process a fetch event and return a `Response` if the resource is covered by this group, |
no test coverage detected