mapbox / mapbox-isochrone

Isochrone generator built atop the Mapbox Matrix API, with CONREC polygonization.
MIT License
119 stars 28 forks source link

Too many requests #11

Closed wboykinm closed 6 years ago

wboykinm commented 6 years ago

Following up on the ambiguous-yet-earnest #9, I looked at the responses to the looped directions API call. I logged the error associated with the call and found this:

"message":"Too Many Requests"

@peterqliu did the platform team feel this module was hammering the API too hard and lock usage down? Any single call still works fine.

peterqliu commented 6 years ago

per chat, we figured out this was due to rate-limiting

wboykinm commented 6 years ago

For future reference, I was able to get around this error to a limited extent by

  1. Playing with the resolution param
  2. Adding a modest (500-2000ms) setTimeout() to the request loop

This would be better-tuneable as a node script, but that's a whole other can of worms. Thanks for the help @peterqliu!

peterqliu commented 6 years ago

👍 thanks for writing out those tips. I just merged a PR that addresses/alleviates some of these relevant troubles https://github.com/mapbox/mapbox-isochrone/pull/14