Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
Cómo controlar la frecuencia de las solicitudes al usar Promise.all()

Necesito algunos datos de otro sitio, así que debo solicitar el sitio uno por uno, pongo la matriz de promises y uso Promise.all(promises) para hacerlo rápido.

Pero el problema es que es demasiado rápido, por lo que el servidor del sitio me bloquea por un tiempo. ¿Cómo controlar la frecuencia de las solicitudes cuando se usa Promise.all()?

El siguiente es mi código:

 (async() => { const request = require('request-promise') let promises = [] let i = 10000 while( i < 0){ promises.push(new Promise(async(r) => { await request({ uri: 'http://somehost_i_need_the_data/' + i }) r() })) i++ } await Promise.all(promises) })()
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!