mapbox / mapbox-sdk-rb

A Ruby interface to Mapbox APIs.
Other
59 stars 32 forks source link

feature request - configurable request timeouts #54

Closed okhwaja closed 2 years ago

okhwaja commented 3 years ago

Hi,

We recently had an issue last ~30minutes where requests to Mapbox were hanging and causing timeouts on our main application server. We'd like to add timeouts on those requests but I noticed that the current implementation does not support configurable timeouts

https://github.com/mapbox/mapbox-sdk-rb/blob/master/lib/mapbox.rb#L43-L48

Is that something we're willing to enable? Ideally we'd like to be able to configure it like access key

Mapbox.access_token = 'xxxxx'
Mapbox.timeout = 5

Happy to put forward a PR