MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / clearDataCache

Function clearDataCache

src/Data/CacheStore.js:116–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 }
115 memoryCache.delete(key);
116 foregroundLoads.delete(key);
117 backgroundLoads.delete(key);
118 return enqueueCacheWrite(key, async () => {
119 if (requestEpoch !== cacheEpoch || version < (latestRequestVersions.get(key) ?? 0)) {
120 return false;
121 }
122 await localforage.removeItem(key);
123 return true;
124 });
125}
126
127export async function clearDataCache() {
128 const theme = await localforage.getItem("theme");
129 cacheEpoch += 1;
130 await Promise.allSettled([...writeQueues.values()]);
131 memoryCache.clear();
132 latestRequestVersions.clear();
133 foregroundRequests.clear();
134 foregroundLoads.clear();
135 backgroundLoads.clear();

Callers 1

emptyCacheFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected