MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / readCacheEntry

Function readCacheEntry

src/Data/CacheStore.js:61–73  ·  view source on GitHub ↗
(key, {legacyFields = [], requestEpoch = cacheEpoch} = {})

Source from the content-addressed store, hash-verified

59}
60
61export async function readCacheEntry(key, {legacyFields = [], requestEpoch = cacheEpoch} = {}) {
62 if (requestEpoch === cacheEpoch && memoryCache.has(key)) {
63 return memoryCache.get(key);
64 }
65 const entry = normalizeCacheEntry(await localforage.getItem(key), legacyFields);
66 if (requestEpoch !== cacheEpoch) {
67 return null;
68 }
69 if (entry) {
70 memoryCache.set(key, entry);
71 }
72 return entry;
73}
74
75export async function writeCacheValue(key, value, {requestEpoch = cacheEpoch, requestVersion} = {}) {
76 if (requestEpoch !== cacheEpoch) {

Callers 4

getMetadataBatchFunction · 0.90
readFreshCachedRecordsFunction · 0.90
getProgramDescsFunction · 0.90
loadCachedValueFunction · 0.85

Calls 1

normalizeCacheEntryFunction · 0.85

Tested by

no test coverage detected