MCPcopy Create free account
hub / github.com/CodeFox-Repo/codefox / shouldUpdateCache

Function shouldUpdateCache

frontend/src/hooks/useModels.ts:20–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 );
19
20 const shouldUpdateCache = (): boolean => {
21 try {
22 const cachedData = sessionStorage.getItem(LocalStore.models);
23 if (!cachedData) return true;
24 const { lastUpdate } = JSON.parse(cachedData) as ModelsCache;
25 const now = Date.now();
26 return now - lastUpdate > CACHE_DURATION;
27 } catch {
28 return true;
29 }
30 };
31
32 const getCachedModels = (): string[] => {
33 try {

Callers 1

useModelsFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected