commit
04a2248e4e
1 changed files with 4 additions and 1 deletions
|
@ -2,7 +2,10 @@ class ApiAdresse::API
|
|||
def self.call(address, limit = 1)
|
||||
search_url = [API_ADRESSE_URL, "search"].join("/")
|
||||
|
||||
RestClient.get(search_url, params: { q: address, limit: limit })
|
||||
RestClient::Request.execute(method: :get,
|
||||
url: search_url,
|
||||
timeout: 5,
|
||||
headers: { params: { q: address, limit: limit } })
|
||||
rescue RestClient::ServiceUnavailable
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue