diff --git a/bin/background_indexer.py b/bin/background_indexer.py index 570fcab8..4f4873b3 100755 --- a/bin/background_indexer.py +++ b/bin/background_indexer.py @@ -36,6 +36,7 @@ class BackgroundIndexer(AbstractManager): try: self.logger.info(f'Build pickle for {uuid}: {uuid_path.parent.name}') self.lookyloo.get_crawled_tree(uuid) + self.logger.info(f'Pickle for {uuid} build.') except NoValidHarFile: self.logger.warning(f'Unable to build pickle for {uuid}: {uuid_path.parent.name}') # The capture is not working, moving it away. @@ -44,10 +45,6 @@ class BackgroundIndexer(AbstractManager): def _check_indexes(self): for cache in self.lookyloo.sorted_capture_cache(): - if cache.incomplete_redirects: - # FIXME: this is dirty and needs to be moved. - self.lookyloo._set_capture_cache(cache.capture_dir, force=True) - cache = self.lookyloo.capture_cache(cache.uuid) # type: ignore if self.lookyloo.is_public_instance and cache.no_index: # Capture unindexed continue diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index caa85da6..99d6cb9e 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -485,6 +485,9 @@ class Lookyloo(): if not c: continue c = CaptureCache(c) + if c.incomplete_redirects: + self._set_capture_cache(c.capture_dir, force=True) + c = self.capture_cache(c.uuid) if hasattr(c, 'timestamp'): all_cache.append(c) all_cache.sort(key=operator.attrgetter('timestamp'), reverse=True)