-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuring HTTP timeouts #186
Comments
Hey @clupprich, Haven't considered adding this yet, there is a timeout configuration for retries on 429 failures. Could you explain a bit further on why would you need this feature? Cheers |
Hej @dlitvakb, With the service disruption last week, we noticed that certain requests did go through to your CDN, but they took a very long time to return a response. In our situation it would have been better to fail early and set the HTTP read timeout to e.g. 5 seconds (instead of the default 60 seconds). I guess this woulnd't only be interesting for Best, |
Hi! We've just experienced the exact issue that @clupprich describes. |
Hey @clupprich and @elhu, I'll take a look into this - and try to get it into the SDK as soon as I can. Cheers |
In the mean time, is there some best practice - or failing that, an ugly hack 😆 - for dealing with Delivery API failures? Preferably a rescue after Delivery API fails to delivery content within X amount of seconds. |
You can always wrap the call in a https://ruby-doc.org/stdlib-2.2.0/libdoc/timeout/rdoc/Timeout.html block, but it's a very brutal way of handling this kind of things and can lead to some nasty surprises. |
I wonder if rack-timeout would be of any use. My application is based on Sinatra. |
@teemutammela if I read that correctly, this is used to terminate a request to your application, not a request your application makes to Contentful. Depending on what you're trying to achieve, it might work as well. |
Is anybody already working on allowing to configure HTTP timeouts for the
Client
?http
allows you to do that, but it's not exposed in the configuration options of the client.The text was updated successfully, but these errors were encountered: