-
-
Save crmaxx/1e6c4f83d081a5fe2879 to your computer and use it in GitHub Desktop.
code review
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_endpoint(id) | |
endpoint = get_node_config('load-balancer', 'hostname') | |
begin | |
ip = Resolv.getaddress(endpoint) | |
response = open("http://#{ip}", 'HOST' => "#{id}.#{endpoint}").read | |
rescue StandardError | |
return false | |
end | |
response | |
end | |
# to | |
def get_endpoint(id) | |
endpoint = get_node_config('load-balancer', 'hostname') | |
ip = Resolv.getaddress(endpoint) | |
open("http://#{ip}", 'HOST' => "#{id}.#{endpoint}").read | |
rescue StandardError | |
return false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment