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

110
Visualizações
How to run service in Express.js regardless of recieved requests

I have a backend application made in nodeJS and express. The main app is divided into separate file, app.js and index.js. app.js is used for managing express, adding its controllers and connecting to MongoDB. index.js is there just for creating server.

Now I would like to implement service, that will check the current state in database, and in case of true, run some code, or function. And that code should be running all the time, regardless of sent requests. It should be a code for itself. So if anyone could tell me what is the best way of implementing this kind of behaviour.

Thank you!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

There can be multiple ways. I am sharing two of them.

  1. Using Scheduling methods of JS which allows you to run some code in a time interval.
  2. Using a Job Manager or scheduler. This article will help you to understand how to build a queue-based job manager using redis.
about 4 years ago · Juan Pablo Isaza 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