updated today to clear out history and refresh everything together.

This commit is contained in:
Martin Donnelly 2016-02-15 09:46:27 +00:00
parent d664262899
commit 23fe4912ec

View File

@ -259,13 +259,14 @@ module.exports = {
},
preLoadToday: function () {
module.exports.getTodayDate();
try {
module.exports.doGetWeatherOutlook();
}
catch (e) {
// statements to handle any exceptions
console.log('ERROR:');
console.log(e);
logger.error(e);
}
try {
@ -273,13 +274,16 @@ module.exports = {
}
catch (e) {
// statements to handle any exceptions
console.log('ERROR:');
console.log(e);
logger.error(e);
}
setTimeout(function () {
module.exports.preLoadToday();
}, todayCache.expire);
try {
module.exports.getHistory();
}
catch (e) {
// statements to handle any exceptions
logger.error(e);
}
}
}
;
@ -329,28 +333,16 @@ function sendEmail() {
}
setTimeout(function () {
// console.log('Pre loading trains...');
module.exports.preLoadToday();
}, 15000);
setTimeout(function () {
// console.log('Pre loading trains...');
module.exports.getTodayDate();
module.exports.getHistory();
}, 25000);
setTimeout(function () {
// console.log('Pre loading trains...');
// saveData();
sendEmailV1();
}, 45000);
cron.schedule('45 6 * * *', function () {
module.exports.getHistory();
module.exports.preLoadToday();
return -1;
});