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

Method readFromCache

web/src/artifact_cache.ts:625–638  ·  view source on GitHub ↗
(url: string, storetype?: string)

Source from the content-addressed store, hash-verified

623 }
624
625 private async readFromCache(url: string, storetype?: string): Promise<any> {
626 if (storetype?.toLowerCase() === "arraybuffer") {
627 const cachedData = await this.store.readArrayBuffer(url);
628 if (cachedData === undefined) {
629 throw new Error("ArtifactOPFSCache failed to fetch: " + url);
630 }
631 return cachedData;
632 }
633 const cachedResponse = await this.store.read(url);
634 if (cachedResponse === undefined) {
635 throw new Error("ArtifactOPFSCache failed to fetch: " + url);
636 }
637 return this.responseToStoreType(cachedResponse, storetype);
638 }
639
640 async addToCache(
641 url: string,

Callers 1

fetchWithCacheMethod · 0.95

Calls 3

responseToStoreTypeMethod · 0.95
readArrayBufferMethod · 0.80
readMethod · 0.65

Tested by

no test coverage detected