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

184
Views
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
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!