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

152
Visualizações
How to call a function recursively for every specified time in node js

Currently We are triggering rate-limiting functionality, each time when user hits the service, code will check for the count in redis, if submission count is within the configured limit, we increment the count and allow the user to perform the operation otherwise we need to recursively check for the limit for every 1 sec until validation succeeds.

async function _rateLimit(key) {
    let islimitExceeded = await redisClient.checkSubmissionCount(key,
        constants.REQUEST_LIMIT); // REQUEST_LIMIT is the configured limit lets take as 10
    if (!islimitExceeded) {
        await redisClient.incrementSubmissionCount(key);// increment the count and allow the user to perform the operation
    }
    else {
            //Need a code which will continuously trigger the ratelimit(key) method
        }
}

Kindly help on this. Thanks

about 4 years ago · Juan Pablo Isaza
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