I\'m using node-cron module for scheduling tasks in Node.js application. I also want run the application in several processes using core cluster module.
Running applica
I think you can use the node cluster module, and there you can write your code to run in the master cluster only
const cluster = require('cluster');
if (cluster.isMaster) {
// Write your code which you want to execute in the master cluster only
}
This is a node way to handle cluster, of course, you can use any tool like pm2 to handle this.