From 64b1c8550df47574b25d2a3470eafa176f1e04c3 Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 18 Dec 2023 12:17:31 -0300 Subject: [PATCH] fix: arreglar uso de promises --- downloader/network.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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)); } /**