diff --git a/bin/background_indexer.py b/bin/background_indexer.py index 42ce211..4838025 100755 --- a/bin/background_indexer.py +++ b/bin/background_indexer.py @@ -38,7 +38,6 @@ class BackgroundIndexer(AbstractManager): # This value makes sure we break out of the loop and build pickles of the most recent captures max_captures = 50 for uuid_path in sorted(self.lookyloo.capture_dir.glob('**/uuid'), reverse=True): - max_captures -= 1 if ((uuid_path.parent / 'tree.pickle.gz').exists() or (uuid_path.parent / 'tree.pickle').exists()): # We already have a pickle file self.logger.debug(f'{uuid_path.parent} has a pickle.') @@ -53,6 +52,7 @@ class BackgroundIndexer(AbstractManager): self.logger.info(f'{uuid_path.parent} is locked, pickle generated by another process.') continue + max_captures -= 1 with uuid_path.open() as f: uuid = f.read()