pstoica / pow-viz

MIT License
2 stars 1 forks source link

mongodb issues #18

Closed vis-123 closed 10 years ago

vis-123 commented 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.

vis-123 commented 10 years ago

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.