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

149
Views
Improving performance in a Nest JS service

I developed a service with Nest JS which calls a third party api in order to get the status related to some pull requests in Azure DevOps. The logic works as follows: I provide an array with links to a function, then I use a for loop to a block of code which will take care of getting the url from the array and build the http request and call the api to retrieve the status(using the axios implementation in Nest JS). It works as an async operation which sequentially makes each request. But it is taking relatively too long(about 160s to get 1000 requests). Does someone have a suggestion in how to improve the speed of execution?

async getAzureStatus(urlAdjusted) {
        const updatedPRStatus = [process.env.EXCEL_COLUMN_PR_STATUS_HEADER];
        
        for(let counter = 1; counter < urlAdjusted.length; counter++) {
            if( urlAdjusted[counter] == 'Not needed')
            {
                updatedPRStatus.push('Not needed');
            }
            else
            {
                const config =
                {
                    headers:
                    {
                        Authorization: process.env.AUTHENTICATION_KEY,
                    },
                };
                try 
                {
                    const response = await lastValueFrom(this.httpService.get(urlAdjusted[counter], config));
                    updatedPRStatus.push(response.data['status']);
                } catch(error) 
                {
                    console.log('error retrieving pr number ' + counter );
                    updatedPRStatus.push('Could not get any data');
                }
            } 
        }
        
        return updatedPRStatus;
    }
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!