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

Avoid connection timeout of "inspec version" #1538

Merged
merged 2 commits into from
Mar 6, 2017

Conversation

makotots
Copy link
Contributor

@makotots makotots commented Mar 5, 2017

Fixes #1537
Signed-off-by: Makoto Nozaki makoto.nozaki@twosigma.com

Signed-off-by: Makoto Nozaki <makoto.nozaki@twosigma.com>
@makotots
Copy link
Contributor Author

makotots commented Mar 5, 2017

Note: The next line, http.read_timeout = 0.5 could be moved up to the same level for consistency.

Copy link
Contributor

@adamleff adamleff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@makotots thank you so much for this PR! I agree that keeping the definition of the options at the same level for consistency is the right thing to do. Would you mind pushing up a new commit with that change? Then I'll be happy to get this approved.

@@ -8,7 +8,8 @@ class LatestInSpecVersion
# fetches the latest version from rubygems server
def latest
uri = URI('https://rubygems.org/api/v1/gems/inspec.json')
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') {|http|
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 0.5) {|http|
http.read_timeout = 0.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your comment that this should be moved up to the #start opts for consistency. Thank you for suggesting it!

Signed-off-by: Makoto Nozaki <makoto.nozaki@twosigma.com>
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @makotots and @adamleff This is a great improvement.

@adamleff
Copy link
Contributor

adamleff commented Mar 6, 2017

Great work, @makotots! Thank you for your contribution!

@adamleff adamleff merged commit f913b56 into inspec:master Mar 6, 2017
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.

None yet

3 participants