fix: arreglar uso de promises

This commit is contained in:
Cat /dev/Nulo 2023-12-18 12:17:31 -03:00
parent 697eb887cf
commit 64b1c8550d

View file

@ -65,8 +65,9 @@ function wait(ms) {
/** /**
* @param {URL} url * @param {URL} url
* @returns {Promise<Dispatcher.ResponseData>}
*/ */
async function _customRequestWithLimits(url) { function _customRequestWithLimits(url) {
let limit = limiters.get(url.host); let limit = limiters.get(url.host);
if (!limit) { if (!limit) {
limit = pLimit( limit = pLimit(
@ -75,9 +76,7 @@ async function _customRequestWithLimits(url) {
); );
limiters.set(url.host, limit); limiters.set(url.host, limit);
} }
return limit(async () => { return limit(() => _customRequest(url));
return await _customRequest(url);
});
} }
/** /**