()
| 908 | function _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 | }); |
no test coverage detected