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

158
Visualizações
`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 Respostas
Responde à pergunta

0

In Rails 5

Make config.allow_concurrency=true in application.rb.

over 4 years ago · Santiago Trujillo Relatório
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