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

186
Vistas
How to return late response from api - node js

I am making request to an api, and they(API owners) mentioned that their response can be immediate and also can be delayed sometimes like sometimes it will be 2 hours but I have to do action on basis of that response. What process should I go with? should I use timers, cron jobs or any better way you can suggest.

//axios,other stuff
const getUsersList = async (req, res) => {
  axios
    .get("https://thirdparty.com/api/some_url/" + req.params.email)
    .then((res) => {
      //this action i want to perform on response but it comes after two hours mostly
      await User.create({
        firstName: res.data.first_name,
      });
    });

  res.status({ message: "your details are saved" });
};

I can't make someone wait for two hours as it will be bad User experience, so what is the procedure to go with?

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