Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
How to deal with timeouts when querying database with NodeJS?

I have a function that returns a promise.

this.getDataFromMainDB()
    .then()
    .catch();

This function gets more than 300.000 records from the main DB and stores it on the microservice DB, so that it can do its job.

It uses an AsyncGenerator (with 1.000 limit), KnexJS to connect to SQL Server.

Now, timeouts occur during this query and it stops.

I thought of using another function on that catch that would take the last ID recorded in the microservice DB and restart the query from than on.

My question is:

  • This approach would generate many concurrent processes, restarting this query in parallel each time a timeout occurs;

OR

  • The process is always the same, it would always be the same process restarting on timeouts, until it finishes the gathering of data?
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda