chore(combobox): add timeout on datasources
This commit is contained in:
parent
2d76e8386e
commit
223e6dfb2d
2 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@ class DataSources::AdresseController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def fetch_results
|
def fetch_results
|
||||||
Typhoeus.get("#{API_ADRESSE_URL}/search", params: { q: params[:q], limit: 10 })
|
Typhoeus.get("#{API_ADRESSE_URL}/search", params: { q: params[:q], limit: 10 }, timeout: 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_results(results)
|
def format_results(results)
|
||||||
|
|
|
@ -31,7 +31,7 @@ class DataSources::CommuneController < ApplicationController
|
||||||
nom: name,
|
nom: name,
|
||||||
boost: 'population',
|
boost: 'population',
|
||||||
limit: 100
|
limit: 100
|
||||||
})
|
}, timeout: 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_by_postal_code(postal_code)
|
def fetch_by_postal_code(postal_code)
|
||||||
|
@ -39,8 +39,8 @@ class DataSources::CommuneController < ApplicationController
|
||||||
type: 'commune-actuelle,arrondissement-municipal',
|
type: 'commune-actuelle,arrondissement-municipal',
|
||||||
codePostal: postal_code,
|
codePostal: postal_code,
|
||||||
boost: 'population',
|
boost: 'population',
|
||||||
limit: 50,
|
limit: 50
|
||||||
})
|
}, timeout: 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def postal_code?(string)
|
def postal_code?(string)
|
||||||
|
|
Loading…
Add table
Reference in a new issue