Issue
const
CronJob = require('cron').CronJob;
(async function() {
// Defining the cron
const job = new CronJob({
cronTime: '* * * * * *',
onTick: () => {console.log("ok")},
timeZone: 'Asia/Kolkata',
start: true
});
})();
cron version 1.4.0
This doesn't print ok every second on v1.4.0 whereas v1.3.0 prints ok every second
So is it a bug?
Solution
It may be that the API has changed on this package...
This is an example from the latest documentation on github https://github.com/kelektiv/node-cron#readme
var CronJob = require('cron').CronJob;
new CronJob('* * * * * *', function() {
console.log('You will see this message every second');
}, null, true, 'America/Los_Angeles');
I would give it a try like that
Answered By - Mikkel Answer Checked By - Cary Denson (WPSolving Admin)