diff --git a/lib/today.js b/lib/today.js index 9cc748a..74d1ea1 100644 --- a/lib/today.js +++ b/lib/today.js @@ -9,7 +9,7 @@ var todayCache = { trains: {last: 0, data: []}, weather: {} }, - expire: ((60 * 1000) * 60) * 1 + expire: ((60 * 1000) * 1) * 1 }; var trainList = [ @@ -72,8 +72,7 @@ module.exports = { for (var i = 0; i < outputArray.length; 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; @@ -82,13 +81,13 @@ module.exports = { }, updateTrains: function () { - todayCache.data.trains.data = []; + console.log('Updating trains..'); + + todayCache.data.trains.data= []; + module.exports.getTrainUpdates(0); module.exports.getTrainUpdates(1); - setTimeout(function () { - module.exports.updateTrains(); - }, todayCache.expire); }, doGetWeatherOutlook: function () {