added hourly cron job to update train and weather

This commit is contained in:
Martin Donnelly 2016-02-16 16:36:49 +00:00
parent 103ef6046b
commit 4150a65220

View File

@ -276,6 +276,25 @@ module.exports = {
});
},
refreshTrainAndWeather:function() {
try {
module.exports.doGetWeatherOutlook();
}
catch (e) {
// statements to handle any exceptions
logger.error(e);
}
try {
module.exports.updateTrains();
}
catch (e) {
// statements to handle any exceptions
logger.error(e);
}
},
preLoadToday: function () {
module.exports.getTodayDate();
var self = this;
@ -387,6 +406,11 @@ cron.schedule('45 6 * * *', function () {
return -1;
});
cron.schedule('0 */1 * * *', function () {
module.exports.refreshTrainAndWeather();
return -1;
});
cron.schedule('0 7 * * *', function () {
sendEmailV1();
// console.log('tick');