diff --git a/downloader/network.js b/downloader/network.js index 7523f7a..cf51741 100644 --- a/downloader/network.js +++ b/downloader/network.js @@ -65,8 +65,9 @@ function wait(ms) { /** * @param {URL} url + * @returns {Promise} */ -async function _customRequestWithLimits(url) { +function _customRequestWithLimits(url) { let limit = limiters.get(url.host); if (!limit) { limit = pLimit( @@ -75,9 +76,7 @@ async function _customRequestWithLimits(url) { ); limiters.set(url.host, limit); } - return limit(async () => { - return await _customRequest(url); - }); + return limit(() => _customRequest(url)); } /**