-
Notifications
You must be signed in to change notification settings - Fork 683
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
Avoid connection timeout of "inspec version" #1538
Conversation
Signed-off-by: Makoto Nozaki <makoto.nozaki@twosigma.com>
Note: The next line, |
There was a problem hiding this 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.
lib/utils/latest_version.rb
Outdated
@@ -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 |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @makotots! Thank you for your contribution! |
Fixes #1537
Signed-off-by: Makoto Nozaki makoto.nozaki@twosigma.com