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

Function _runFolderStats

public/js/fileListView.js:3118–3134  ·  view source on GitHub ↗
(url, timeoutMs)

Source from the content-addressed store, hash-verified

3116}
3117
3118function _runFolderStats(url, timeoutMs) {
3119 return new Promise(resolve => {
3120 const start = () => {
3121 _activeFolderStatsReqs++;
3122 _fetchJSONWithTimeout(url, timeoutMs || 2500)
3123 .then(resolve)
3124 .finally(() => {
3125 _activeFolderStatsReqs--;
3126 const next = _folderStatsQueue.shift();
3127 if (next) next();
3128 });
3129 };
3130
3131 if (_activeFolderStatsReqs < MAX_CONCURRENT_FOLDER_STATS_REQS) start();
3132 else _folderStatsQueue.push(start);
3133 });
3134}
3135
3136function fetchFolderStats(folder, sourceId = '') {
3137 if (!folder) return Promise.resolve(null);

Callers 1

fetchFolderStatsFunction · 0.85

Calls 1

startFunction · 0.70

Tested by

no test coverage detected