Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda