mirror of
https://gitlab.silvrtree.co.uk/martind2000/old-silvrgit.git
synced 2025-01-10 21:45:08 +00:00
added hourly cron job to update train and weather
This commit is contained in:
parent
103ef6046b
commit
4150a65220
24
lib/today.js
24
lib/today.js
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user