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

Function syncCoreCache

src/Data/CoreCacheSync.js:104–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104async function syncCoreCache() {
105 if (syncRunning || !navigator.onLine) {
106 return;
107 }
108 syncRunning = true;
109 const syncEpoch = getCacheEpoch();
110 try {
111 const {programs, applicants} = await prefetchCoreCache();
112 if (!shouldContinue(syncEpoch)) {
113 return;
114 }
115 await prefetchProgramDescriptions(collectProgramIds(programs), syncEpoch);
116 await prefetchProfiles(applicants, syncEpoch);
117 } finally {
118 syncRunning = false;
119 if (active && syncEpoch !== getCacheEpoch()) {
120 scheduleSync();
121 }
122 }
123}
124
125function scheduleSync() {
126 if (!active || idleHandle !== null) {

Callers 1

runFunction · 0.85

Calls 7

getCacheEpochFunction · 0.90
prefetchCoreCacheFunction · 0.85
shouldContinueFunction · 0.85
collectProgramIdsFunction · 0.85
prefetchProfilesFunction · 0.85
scheduleSyncFunction · 0.85

Tested by

no test coverage detected