Added http logs and http timeouts for the geocoder cache

pull/6748/head
Mario de Frutos 9 years ago
parent 57bace85ea
commit 951c988255

@ -53,7 +53,7 @@ module CartoDB
end
end
@status = 'completed'
update_stats_log
update_log_stats
@log.append_and_store "Non-batch Here geocoding job finished"
end

@ -7,6 +7,8 @@ module CartoDB
DEFAULT_BATCH_SIZE = 5000
DEFAULT_MAX_ROWS = 1000000
HTTP_CONNECT_TIMEOUT = 60
HTTP_DEFAULT_TIMEOUT = 600
attr_reader :connection, :working_dir, :table_name, :hits, :misses,
:max_rows, :sql_api, :formatter, :cache_results
@ -134,11 +136,12 @@ module CartoDB
def run_query(query, format = '')
params = { q: query, api_key: sql_api[:api_key], format: format }
http_client = Carto::Http::Client.get('geocoder_cache')
response = http_client.post(
sql_api[:base_url],
body: URI.encode_www_form(params)
)
http_client = Carto::Http::Client.get('geocoder_cache',
log_requests: true,
connecttimeout: HTTP_CONNECT_TIMEOUT,
timeout: HTTP_DEFAULT_TIMEOUT)
response = http_client.post(sql_api[:base_url],
body: URI.encode_www_form(params))
response.body
end

Loading…
Cancel
Save