From 063b321e9e4ba9120334fb575d394bc48f91d18e Mon Sep 17 00:00:00 2001 From: Alexey Pechnikov Date: Fri, 23 Aug 2024 22:27:50 +0700 Subject: [PATCH] Use more attempts to download bursts --- pygmtsar/pygmtsar/ASF.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygmtsar/pygmtsar/ASF.py b/pygmtsar/pygmtsar/ASF.py index c01e122..d75ecad 100644 --- a/pygmtsar/pygmtsar/ASF.py +++ b/pygmtsar/pygmtsar/ASF.py @@ -282,8 +282,8 @@ def download_bursts(self, basedir, bursts, session=None, n_jobs=8, joblib_backen # supress asf_search 'UserWarning: File already exists, skipping download' warnings.filterwarnings("ignore", category=UserWarning) # repeat failed downloads - retries = 100 - retries_timeout = 2 + retries = 300 + retries_timeout = 3 def filter_azimuth_time(items, start_utc_dt, stop_utc_dt, delta=3): return [item for item in items if @@ -400,7 +400,7 @@ def download_burst(result, basedir, session): print(f"Failed attempt {retry+1} to download {tmp_file}: {e}") time.sleep(retries_timeout) # check if the file is really downloaded - assert os.path.exists(tmp_file), f'ERROR: TiFF file {tmp_file} is not downloaded and validated' + assert os.path.exists(tmp_file), f'ERROR: TiFF file {tmp_file} is not downloaded and validated in {retries} retries' # move to persistent name os.rename(tmp_file, tif_file) @@ -437,7 +437,7 @@ def download_burst(result, basedir, session): print(f"Failed attempt {retry+1} to download and parse {manifest_file}: {e}") time.sleep(retries_timeout) # check if the file is really downloaded - assert os.path.exists(manifest_file), f'ERROR: manifest file {manifest_file} is not downloaded and validated' + assert os.path.exists(manifest_file), f'ERROR: manifest file {manifest_file} is not downloaded and validated in {retries} retries' # parse xml with open(manifest_file, 'r') as file: xml_content = file.read()