fff.js 502 B

123456789101112131415161718
  1. var schedule = require('./');
  2. // Create new cron for each iteration (creating 1-10 mins)
  3. //for (var x = 1; x<10; x++){
  4. // var rule = new schedule.RecurrenceRule();
  5. // rule.minute = new schedule.Range(0, 59, x);
  6. // schedule.scheduleJob(rule, function() {
  7. // // Can I access the RULE which is being executed NOW somehow?!
  8. // console.log(this);
  9. // });
  10. //}
  11. var job = schedule.scheduleJob('* * * * * *', function() {
  12. console.log(this.spec);
  13. });
  14. job.spec = '* * * * * *';