Closed mdkwant closed 2 years ago
And including a log message when maximum number is reached:
Line 1457:
if attempt > attempts:
msg = "Maximum number of attempts reached"
self._log_msg(msg)
return []
Maximum attempts has been added when downloading images for v1.4.0
Request to add feature to have a maximum number of attempts the download query will try to attempt to download. Where a timetout error is given when the maximum number of attempts is reached. Use case: We use this script operationally and sometimes server space is needed after say x ammount of time. We need to have the option to stop the script after x ammount of time is passed so other activities can be started.
in line 1389
def download(self, items, dest, wait=60.0, attempts=5):
and in line 1447 - 1455
` attempt = 1 complete_items = [] while len(unique_items) > len(complete_items) and attempt <= attempts: time.sleep(wait) attempt += 1