(url: string)
| 84 | } |
| 85 | |
| 86 | async cacheStatus(url: string): Promise<UpdateCacheStatus> { |
| 87 | const cache = await this.cache; |
| 88 | const meta = await this.metadata; |
| 89 | const req = this.adapter.newRequest(url); |
| 90 | const res = await cache.match(req, this.config.cacheQueryOptions); |
| 91 | if (res === undefined) { |
| 92 | return UpdateCacheStatus.NOT_CACHED; |
| 93 | } |
| 94 | try { |
| 95 | const data = await meta.read<UrlMetadata>(req.url); |
| 96 | if (!data.used) { |
| 97 | return UpdateCacheStatus.CACHED_BUT_UNUSED; |
| 98 | } |
| 99 | } catch (_) { |
| 100 | // Error on the side of safety and assume cached. |
| 101 | } |
| 102 | return UpdateCacheStatus.CACHED; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Initialize this asset group, updating from the given source if available. |
nothing calls this directly
no test coverage detected
searching dependent graphs…