I am trying to run a cron job after 10 minutes, sometimes it runs after 10 minutes and sometimes it runs after like 2 minutes when I call the webservice. Below is the code
router.post('/getUser', function (req, res) {
var task = cron.schedule('0 */10 * * * *', function () {
console.log("cron job started")
}, false);
task.start();
})
It should always runs after 10 minutes not like sometime 2 minutes as soon as the webservice is called.