MCPcopy
hub / github.com/angular/angular / syncLru

Method syncLru

packages/service-worker/worker/src/data.ts:281–297  ·  view source on GitHub ↗

* Sync the LRU chain to non-volatile storage.

()

Source from the content-addressed store, hash-verified

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,

Callers 3

handleFetchMethod · 0.95
loadFromCacheMethod · 0.95
cacheResponseMethod · 0.95

Calls 3

detectStorageFullMethod · 0.95
writeMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected