Closed vis-123 closed 10 years ago
so i ended up getting the same issues that cameron was getting in class when i tried it at home. the thing that made them go away was waiting 10 seconds before executing my test case to ensure the db had had time to initialize by doing:
setTimeout(function(){ da.getStateData(new Date('2011'), new Date('2012'), 'GA', function(err, prices, stats){ console.log(prices); }); }, 10000);
i'll try and help find a way to make sure that any db dependent methods only get executed after the db is definitely initialized.
resolved with a null check in each of the data aggregator prototype methods to return out of the method execution to avoid potential db errors.
so i ended up getting the same issues that cameron was getting in class when i tried it at home. the thing that made them go away was waiting 10 seconds before executing my test case to ensure the db had had time to initialize by doing:
setTimeout(function(){ da.getStateData(new Date('2011'), new Date('2012'), 'GA', function(err, prices, stats){ console.log(prices); }); }, 10000);
i'll try and help find a way to make sure that any db dependent methods only get executed after the db is definitely initialized.