Skip to content

Commit 91d4572

Browse files
committed
multi attempt for igs download if failed
1 parent dd0f245 commit 91d4572

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/parsers/test_ephemeris.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,15 @@ def test_request_igs(ephem_download_path, fileinfo):
287287

288288
requests_url = fileinfo['url'] + fileinfo['filepath']
289289

290-
response = requests.get(requests_url, timeout=5)
290+
291+
fail_count = 0
292+
while fail_count < 3:
293+
try:
294+
response = requests.get(requests_url, timeout=5)
295+
break
296+
except ConnectionError:
297+
fail_count += 1
298+
291299
with open(dest_filepath,'wb') as file:
292300
file.write(response.content)
293301

0 commit comments

Comments
 (0)