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

157
Views
`rails server` hangs when there are multiple requests at the same time

I have an angular2 app. I am using resolve to get some data before navigating to a route.

I was doing this in the route:

resolve: {
        businessRules: NewEventResolverService,
        countries: NewEventCountriesResolverService,
        locations: NewEventLocationsResolverService
}

Each of these services sends a GET request to my Rails API server (Rails 5). So, when I was navigating to the said route, the rails server would hang and wasn't returning any data.

Then I changed it to only one resolver service:

resolve: {
        allPrerequisites: NewEventResolverService
}

And in the resolver service, sent the GET request one after the other.

resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<any> {
    return this.service.getActiveBusinessRule().then((lookupRecords: LookupKeyValuePair[]) => {
        return this.service.getActiveCountries().then((countries: Country[]) => {
            return this.service.getActiveLocationsOfClient().then((locations: Location[]) => {
                return {
                        lookupRecords: lookupRecords,
                        countries: countries,
                        locations: locations
                }
            })
        })
    })
}

This time the server didn't hang. How do I make it work with multiple concurrent requests to the rails server?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In Rails 5

Make config.allow_concurrency=true in application.rb.

over 4 years ago · Santiago Trujillo Report
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!