From 7136c259b487824e18ffbd2d44360f0df2504cda Mon Sep 17 00:00:00 2001 From: semio Date: Tue, 19 Jan 2021 11:39:21 +0800 Subject: [PATCH] sleep time in ihme download link checking --- ddf_utils/factory/ihme.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ddf_utils/factory/ihme.py b/ddf_utils/factory/ihme.py index a27a78c..fdd5132 100644 --- a/ddf_utils/factory/ihme.py +++ b/ddf_utils/factory/ihme.py @@ -77,7 +77,9 @@ def download_links(self, url): while True: res_json = session.get(url).json() - + if 'urls' not in res_json: + sleep(30) + continue dus = res_json['urls'] for du in dus: if du in sent_urls: @@ -89,7 +91,7 @@ def download_links(self, url): if res_json['state'] in success_results: break - sleep(10) + sleep(30) def bulk_download(self, out_dir, version, context, **kwargs): """download the selected contexts/queries from GBD result tools.