Does Node follow the schedule / new round of the process

Is there a node-scheduling npm spwan / fork module for the new process, or should we do it ourselves?

var cron = require('node-schedule');
var cronExpress="0 * * * *";

 cron.scheduleJob(cronExpress, () => {
            //logger.info("Cron expression Rule "+Date());
            doSomething();
        });

Using the code snippet above, the task starts in the same instance or invokes another process. i. does node -schedule handle this?

+4
source share
1 answer

cron.scheduleJob(cronExpress, () => { shell.exec(node ../jobs/job1.js'); }) // you can use shelljs or childprocess while doing something, childProcess ( https://nodejs.org/api/child_process.html )

0
source

Source: https://habr.com/ru/post/1660039/


All Articles