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

move is_expected calculation to own function

Just reorganization for clarity
parent 859dd641
No related branches found
No related tags found
No related merge requests found
......@@ -514,6 +514,10 @@ class Downloader:
fileset_list_list.append(fileset_list)
return fileset_list_list
def is_expected(self, time):
if self.expected_newest is None:
return False
return time < (datetime.datetime.now() - self.expected_newest )
def get_filesets_for_time(self, time):
""" Return list of FileSets suitable for use at time
......@@ -546,9 +550,7 @@ class Downloader:
local = self._expand(self.local, time, priority)
urls_to_files = {url_relative: local}
expected = False
if self.expected_newest is not None:
expected = time < (datetime.datetime.now() - self.expected_newest )
expected = self.is_expected(time)
priority_desc = f'"{priority}"' if priority != "" else '"" (empty string)'
description = f"{self.name} for {time} at priority {priority_desc}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment