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

Function fetchJSONWithTimeout

public/js/folderManager.js:892–899  ·  view source on GitHub ↗
(url, ms = 3000)

Source from the content-addressed store, hash-verified

890}
891
892function fetchJSONWithTimeout(url, ms = 3000) {
893 const ctrl = new AbortController();
894 const tid = setTimeout(() => ctrl.abort(), ms);
895 return fetch(url, { credentials: 'include', signal: ctrl.signal })
896 .then(r => r.ok ? r.json() : { folders: 0, files: 0, __fr_err: 1 })
897 .catch(() => ({ folders: 0, files: 0, __fr_err: 1 }))
898 .finally(() => clearTimeout(tid));
899}
900const MAX_CONCURRENT_COUNT_REQS = 6;
901let _activeCountReqs = 0;
902const _countReqQueue = [];

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected