fix: Put the max captures counter at the right place...

pull/746/head
Raphaël Vinot 2023-07-26 11:45:22 +02:00
parent fc5850e147
commit f60457a484
1 changed files with 1 additions and 1 deletions

View File

@ -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()