Skip to content
Snippets Groups Projects
Commit 0f6992a2 authored by Alan De Smet's avatar Alan De Smet
Browse files

Bug fixes from last

Bail early if all files present. Essential to avoid errors about
downloads being disabled when required files are present.

Ignore errors when mirroring; logging is all we need to do.
parent d28bc72e
Branches
No related tags found
No related merge requests found
...@@ -334,6 +334,9 @@ def download_all(url_to_dst, download_stats, do_download, timeout): ...@@ -334,6 +334,9 @@ def download_all(url_to_dst, download_stats, do_download, timeout):
else: else:
todo[src] = dst todo[src] = dst
if len(todo) == 0:
return
if not do_download: if not do_download:
raise DownloadsDisabledException(f"Some requested files are not present, and downloads were disabled. Files: {list(todo.values())}") raise DownloadsDisabledException(f"Some requested files are not present, and downloads were disabled. Files: {list(todo.values())}")
...@@ -895,8 +898,11 @@ class Downloader: ...@@ -895,8 +898,11 @@ class Downloader:
filesets = self.get_filesets_for_time(time) filesets = self.get_filesets_for_time(time)
timeout = self.get_timeout(timeout) timeout = self.get_timeout(timeout)
retries = self.get_retries(retries)
retry_wait = self.get_retry_wait(retry_wait) retry_wait = self.get_retry_wait(retry_wait)
if do_download:
retries = self.get_retries(retries)
else:
retries = 1
return self.download_first_available(filesets, dst, timeout=timeout, retries=retries, retry_wait=retry_wait, do_download = do_download, download_stats = download_stats) return self.download_first_available(filesets, dst, timeout=timeout, retries=retries, retry_wait=retry_wait, do_download = do_download, download_stats = download_stats)
...@@ -931,8 +937,14 @@ class Downloader: ...@@ -931,8 +937,14 @@ class Downloader:
timeout = self.get_timeout(timeout) timeout = self.get_timeout(timeout)
for filesets in filesets_list_list: for filesets in filesets_list_list:
try:
self.download_first_available(filesets, dst, timeout=timeout, retries=1, retry_wait=1, download_stats = download_stats) self.download_first_available(filesets, dst, timeout=timeout, retries=1, retry_wait=1, download_stats = download_stats)
except:
# We just keep trucking on; missed files are unfortunate,
# but not much we can do.
pass
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment