fix: build backlog pickles in reverse order

pull/833/head
Raphaël Vinot 2023-11-16 23:58:07 +01:00
parent 096d7c6fb5
commit ce76218657
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class BackgroundIndexer(AbstractManager):
archive_interval = timedelta(days=get_config('generic', 'archive'))
cut_time = (datetime.now() - archive_interval)
for month_dir in make_dirs_list(self.lookyloo.capture_dir):
for capture_time, path in get_sorted_captures_from_disk(month_dir, cut_time=cut_time, keep_more_recent=True):
for capture_time, path in sorted(get_sorted_captures_from_disk(month_dir, cut_time=cut_time, keep_more_recent=True), reverse=True):
if ((path / 'tree.pickle.gz').exists() or (path / 'tree.pickle').exists()):
# We already have a pickle file
self.logger.debug(f'{path} has a pickle.')