mirror of
https://gitlab.silvrtree.co.uk/martind2000/old-silvrgit.git
synced 2025-02-14 08:19:16 +00:00
fixes bunny requests
This commit is contained in:
parent
0531b14949
commit
9449f58976
13
lib/today.js
13
lib/today.js
@ -9,7 +9,7 @@ var todayCache = {
|
|||||||
trains: {last: 0, data: []},
|
trains: {last: 0, data: []},
|
||||||
weather: {}
|
weather: {}
|
||||||
},
|
},
|
||||||
expire: ((60 * 1000) * 60) * 1
|
expire: ((60 * 1000) * 1) * 1
|
||||||
};
|
};
|
||||||
|
|
||||||
var trainList = [
|
var trainList = [
|
||||||
@ -72,8 +72,7 @@ module.exports = {
|
|||||||
for (var i = 0; i < outputArray.length; i++) {
|
for (var i = 0; i < outputArray.length; i++) {
|
||||||
todayCache.data.trains.data.push(outputArray[i])
|
todayCache.data.trains.data.push(outputArray[i])
|
||||||
}
|
}
|
||||||
console.log("outputArray array length:" + outputArray.length);
|
|
||||||
console.log("array length:" + todayCache.data.trains.data.length);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
todayCache.data.trains.last = now;
|
todayCache.data.trains.last = now;
|
||||||
@ -82,13 +81,13 @@ module.exports = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
updateTrains: function () {
|
updateTrains: function () {
|
||||||
todayCache.data.trains.data = [];
|
console.log('Updating trains..');
|
||||||
|
|
||||||
|
todayCache.data.trains.data= [];
|
||||||
|
|
||||||
module.exports.getTrainUpdates(0);
|
module.exports.getTrainUpdates(0);
|
||||||
module.exports.getTrainUpdates(1);
|
module.exports.getTrainUpdates(1);
|
||||||
|
|
||||||
setTimeout(function () {
|
|
||||||
module.exports.updateTrains();
|
|
||||||
}, todayCache.expire);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
doGetWeatherOutlook: function () {
|
doGetWeatherOutlook: function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user