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

328
Vistas
node-cron vs setInterval() in setting a database checker job that runs every minute

I was looking on how to implement post scheduling feature in my app, then I discovered node-cron. So theoretically, I can do it using node-cron where the cron job will run every minute and checks the database if a post is due to be posted, and finally post it to the newsfeed.

Then I remembered setInterval(). Javascript setInterval() I think also do the exact same thing with using node-cron. What could be the difference between these two? If setInterval() would also do the job without problems, then I think I should go with it, since it's simpler and native javascript function.

What do you think? I've been searching for answers, but it seems that the opinions for this is 50/50, and there's not much discussion about this matter. Some recommend just using setInterval() if i'm not planning to set a specific date/time. That's right I only wanted to run my job every minute, but then I also read about memory leak in setInterval() which I don't understand fully.

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