MCPcopy Create free account
hub / github.com/apache/tvm / fetchWithCache

Method fetchWithCache

web/src/artifact_cache.ts:703–718  ·  view source on GitHub ↗
(
    url: string,
    storetype?: StoreType,
    signal?: AbortSignal,
  )

Source from the content-addressed store, hash-verified

701 }
702
703 async fetchWithCache(
704 url: string,
705 storetype?: StoreType,
706 signal?: AbortSignal,
707 ): Promise<any> {
708 const cachedResponse = await this.storage.match(url);
709 if (cachedResponse !== undefined) {
710 return this.responseToStoreType(cachedResponse, storetype);
711 }
712 await this.addToCache(url, storetype, signal);
713 const hydrated = await this.storage.match(url);
714 if (hydrated === undefined) {
715 throw new Error(`ArtifactCrossOriginStorageCache: failed to hydrate ${url}`);
716 }
717 return this.responseToStoreType(hydrated, storetype);
718 }
719
720 async addToCache(
721 url: string,

Callers

nothing calls this directly

Calls 3

responseToStoreTypeMethod · 0.95
addToCacheMethod · 0.95
matchMethod · 0.45

Tested by

no test coverage detected