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

374
Visualizações
CRON is running twice in Node js

In nodejs I have scheduled a CRON that is running every day at 10 AM to send the push notification. Now the issue is, every time when this CRON is triggering 2 notifications are being sent to the user's device. Here is my code

var job2 = new CronJob('00 00 10 * * *', (res) => { woStatusCheck(); }, null, true, 'Asia/Kolkata'); job2.start();

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can check their documentation. 4th parameter of the constructor is named start and by sending true for it, it will run the job before exiting the constructor. Then calling your job.start() runs it again. You either send false at 4th parameter and use the .start() or remove the .start() and send true

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