Skip to content

Instantly share code, notes, and snippets.

@avermeulen
Created July 16, 2018 13:41
Show Gist options
  • Save avermeulen/f94271aaa2c5eb9589856a646d44c486 to your computer and use it in GitHub Desktop.
Save avermeulen/f94271aaa2c5eb9589856a646d44c486 to your computer and use it in GitHub Desktop.
var schedule = require('node-schedule');
schedule.scheduleJob( process.env.SCHEDULE_SETTINGS || '00 00 6 * * *', function(runAt){
console.log(runAt);
// is this the last day of the month?
// if it is... call the function to create the metric instances
// let taskList = getAllTasks();
// taskList.forEeach((task) => {
// try {
// if (task.active()){
// task.execute();
// }
// }
// catch(err){
// // log any errors!
// }
// })
createMetricRequests(endOfMonthDate);
sendEmailRemindersForOpenMetricRequests(endOfMonthDate);
console.log('The answer to life, the universe, and everything!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment