Set Interval in Node.js vs. Cron Job?

My question is are there any disadvantages to running a set up like this compared to a traditional cron job set up?

As long as //run the code isn’t a CPU-bound thing like cryptography, stick with 1 node process, at least to start. Since you are requiring request I guess you might be making an HTTP request, which is IO, which means this will be fine.

It’s just simpler to have 1 thing to install/launch/start/stop/upgrade/connect-a-debugger than to deal with an app server as well as a separate cron-managed process. For what it’s worth, keeping it in javascript makes it portable across platforms, although that probably doesn’t really matter.

There is also a handy node-cron module which I have used as well as approximately one bazillion other alternatives.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)