sensebox / openSenseMap-API

API for opensensemap.org
https://docs.opensensemap.org/
MIT License
49 stars 41 forks source link

/boxes?date= returns nothing #107

Open noerw opened 7 years ago

noerw commented 7 years ago

https://api.opensensemap.org/boxes?date=2017-08-06T00:00:00Z,2017-08-10T12:49:51Z

noerw commented 7 years ago

sometimes an empty response is returned, sometimes

{"code":"InternalServerError","message":"connection 16 to 172.31.46.193:27017 timed out"}
ubergesundheit commented 7 years ago

Seems the aggregation executed when requesting the route with date parameters does not receive data in time thus timing out. (https://github.com/sensebox/openSenseMap-API/blob/42a55ec1b78a976cf58bdfa93007d31591287972/lib/controllers/boxesController.js#L530-L548)

I have no particular plans, but in the long run I have to think about speeding up the aggregation or using some trick to cache the information if there is data for a particular timeframe or not.