MCPcopy Create free account
hub / github.com/error311/FileRise / _runCount

Function _runCount

public/js/folderManager.js:908–923  ·  view source on GitHub ↗
(url, timeoutMs)

Source from the content-addressed store, hash-verified

906 return 2500;
907}
908function _runCount(url, timeoutMs) {
909 return new Promise(resolve => {
910 const start = () => {
911 _activeCountReqs++;
912 fetchJSONWithTimeout(url, timeoutMs || 2500)
913 .then(resolve)
914 .finally(() => {
915 _activeCountReqs--;
916 const next = _countReqQueue.shift();
917 if (next) next();
918 });
919 };
920 if (_activeCountReqs < MAX_CONCURRENT_COUNT_REQS) start();
921 else _countReqQueue.push(start);
922 });
923}
924function scheduleFolderStatsWork(fn, timeoutMs = 700) {
925 if (typeof requestIdleCallback === 'function') {
926 requestIdleCallback(() => { try { fn(); } catch (e) {} }, { timeout: timeoutMs });

Callers 1

fetchFolderCountsFunction · 0.85

Calls 1

startFunction · 0.70

Tested by

no test coverage detected