Lower timeout for API Entreprise

This commit is contained in:
Paul Chavard 2018-03-27 17:16:56 +02:00
parent 0fda88512c
commit 5ae8eb3383

View file

@ -8,6 +8,8 @@ class ApiEntreprise::API
EXERCICES_RESOURCE_NAME = "exercices" EXERCICES_RESOURCE_NAME = "exercices"
RNA_RESOURCE_NAME = "associations" RNA_RESOURCE_NAME = "associations"
TIMEOUT = 10
def initialize def initialize
end end
@ -34,7 +36,7 @@ class ApiEntreprise::API
response = Typhoeus.get(url, response = Typhoeus.get(url,
ssl_verifypeer: false, ssl_verifypeer: false,
params: params, params: params,
timeout: 20) timeout: TIMEOUT)
if response.success? && response.code != 206 if response.success? && response.code != 206
JSON.parse(response.body, symbolize_names: true) JSON.parse(response.body, symbolize_names: true)