Skip to content
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

Set Net::HTTP open_timeout and read_timeout #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pranas
Copy link

@pranas pranas commented Apr 24, 2014

We've been experiencing network issues when connecting to KissMetrics. Metrics are not important enough to bring the whole application down. This change let us to set Net::HTTP timeouts and kill requests taking too long.

This is how we solved our problem and I'd like to see the change in the official gem. A few things to discuss:

  1. We use timeout of 3 seconds, it might be too harsh default for some users?
  2. Maybe we should allow to customise both open_timeout and read_timeout separately? Or maybe we should put the whole Net::HTTP code in Timeout::Timeout block and set a single timeout instead of open_timeout and read_timeout

Let me know what you think and I'll update my PR accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant