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

159
Vistas
`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 Respuestas
Responde la pregunta

0

In Rails 5

Make config.allow_concurrency=true in application.rb.

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