I am using a node module called node-schedule
I have this feature, it is expected to fire ONCE at the beginning of each quarter.
var rule = {hour: 0, minute: 0, day: 1, month: [0, 3, 6, 9]};
var logCost = schedule.scheduleJob(rule, function(){
console.log('logCost output this shit at: ' + dateFormat(Date(), 'isoTime'));
});
The problem is that the function simply continues to run throughout the day (the first day of the month). How to rewrite this to execute only once, maybe something is wrong with my rule variable, but I don’t see that.
source
share