Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!