Al ejecutar este código, aparece el error "la cola de aceleración supera la capacidad máxima" y no sé cómo hacer que funcione.
La función que se llama para el servicio en sí es una llamada de función asíncrona a una API de terceros. No pude encontrar ninguna implementación que funcione para mi ejemplo y espero encontrar a alguien que me explique qué está sucediendo aquí.
Gracias
async analyze() { const markets = Object.values(this.service.getMarkets()).filter( (m) => this.markets.includes(m.quoteId) && m.active ); const tasks = []; for (let i = 0; i < markets.length; i++) { //market iteration const symbol = markets[i].symbol; for (let j = 0; j < this.timeframes.length; j++) { //timeframe iteration const timeframe = this.timeframes[j]; tasks.push(this.service.getOHLCV(symbol, timeframe)); } } console.log("Tasks to be executed", tasks.length); const startTime = Date.now(); const ohlcvDatasets = await Promise.all(tasks); const endTime = Date.now() - startTime; console.log(`executed ${tasks.length} tasks in ${endTime} ms`); this.analyzeRSI(ohlcvDatasets); }this.service.getOHLCV() devuelve una Promesa. La función en la clase de servicio utiliza una biblioteca de terceros que llama a una API externa.
Al igual que.
getOHLCV(){ devuelve 3rdPartyAPICall }