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

Function prefetchInBatches

src/Data/CoreCacheSync.js:64–69  ·  view source on GitHub ↗
(items, batchSize, syncEpoch, loadBatch)

Source from the content-addressed store, hash-verified

62}
63
64async function prefetchInBatches(items, batchSize, syncEpoch, loadBatch) {
65 for (let index = 0; index < items.length && shouldContinue(syncEpoch); index += batchSize) {
66 await waitForIdle(syncEpoch);
67 await loadSafely(() => loadBatch(items.slice(index, index + batchSize)));
68 }
69}
70
71async function prefetchProgramDescriptions(programIds, syncEpoch) {
72 await prefetchInBatches(programIds, DESCRIPTION_BATCH_SIZE, syncEpoch, (batch) => (

Callers 2

prefetchProfilesFunction · 0.85

Calls 3

shouldContinueFunction · 0.85
waitForIdleFunction · 0.85
loadSafelyFunction · 0.85

Tested by

no test coverage detected