|
|
|
@ -15,7 +15,7 @@ |
|
|
|
|
|
|
|
|
|
console.log('=== Starting next promise chain.'); |
|
|
|
|
|
|
|
|
|
var station = 46026 //stations.ids[index];
|
|
|
|
|
var station = stations.ids[index]; |
|
|
|
|
|
|
|
|
|
Promise.resolve() |
|
|
|
|
//===== Download
|
|
|
|
@ -26,23 +26,21 @@ |
|
|
|
|
|
|
|
|
|
//===== Parse
|
|
|
|
|
// .then(stations.parseStation.bind(null, station))
|
|
|
|
|
// .then(meteo.parseAllMonths.bind(null, 46026, 2015))
|
|
|
|
|
// .then(meteo.parseAllMonths.bind(null, station, 2015))
|
|
|
|
|
// .then(meteo.parseAllYears.bind(null, station, 1982, 2014))
|
|
|
|
|
|
|
|
|
|
//===== Assemble
|
|
|
|
|
.then(assemble.read.bind(null, station, 2015)) |
|
|
|
|
.then(assemble.getAverages) |
|
|
|
|
// .then(assemble.read.bind(null, station, 2015))
|
|
|
|
|
// .then(assemble.getAverages)
|
|
|
|
|
|
|
|
|
|
// .then(function() { console.log('something') })
|
|
|
|
|
|
|
|
|
|
//===== Flow control
|
|
|
|
|
.then(function() { console.log('=== Chain complete.\n'); }) |
|
|
|
|
// .then(function() { console.log('=== Chain complete.\n'); })
|
|
|
|
|
// .then(next.bind(null, index + 1))
|
|
|
|
|
.catch(IO.error); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// TODO remove previous years from file, such as 46026-2015 shouldn't have data from 2014.
|
|
|
|
|
|
|
|
|
|
next(0); |
|
|
|
|
})(); |
|
|
|
|