Commit 8e97fb36 authored by Bruno Duyé's avatar Bruno Duyé

Minor: wording

parent e9f40e5e
......@@ -67,7 +67,7 @@ def main():
requests_session = Session()
# http://www.coglib.com/~icordasc/blog/2014/12/retries-in-requests.html
# backoff_factor=2 will make sleep for 2 * (2 ^ (retry_number - 1)), ie 0, 2, 4, 8, 16, 32 ... up to 1 hour (for total=12)
requests_retry = Retry(total=12, backoff_factor=2, status_forcelist=[104, 500, 501, 502, 503, 504]) # retry when server return ont of this statuses
requests_retry = Retry(total=12, backoff_factor=2, status_forcelist=[104, 500, 501, 502, 503, 504]) # retry when server return one of those statuses
requests_session.mount('http://', HTTPAdapter(max_retries=requests_retry))
requests_session.mount('https://', HTTPAdapter(max_retries=requests_retry))
# Parse command line arguments
......@@ -89,11 +89,11 @@ def main():
log.info("** {}".format(appendix_code))
datasets_list_url = appendix_dict['api']['datasets_list_url'].format(
api_user_id=api_user_id, appendix_code=appendix_code)
datasets_list = get_from_api(datasets_list_url)
returned_datasets_list = get_from_api(datasets_list_url)
nb_tables_downloaded = 0
datasets_json = [] # Data to be written to datasets.json
# For each dataset
for dataset_info in datasets_list["ParamValue"]:
for dataset_info in returned_datasets_list["ParamValue"]:
dataset_code = dataset_info.get('TableName') or dataset_info.get(
'TableID') or dataset_info.get('TableNumber') or dataset_info.get('Key')
assert dataset_code, "Error: can't find dataset code in dataset_info (dataset {!r}):\n{!r}".format(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment