MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / doLoad

Function doLoad

src/hooks/useAsyncImageCache.ts:196–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195 return new Promise((resolve) => {
196 const doLoad = () => {
197 if (generation !== state.cacheGeneration) {
198 // clear() was called - it already reset activeLoads, don't decrement
199 resolve(null);
200 return;
201 }
202 loadFromFile(imageFile, cacheKey, generation).then(resolve);
203 };
204
205 if (state.activeLoads < MAX_CONCURRENT_LOADS) {
206 state.activeLoads++;

Callers 1

queueLoadFunction · 0.85

Calls 2

loadFromFileFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected