chg: Avoid to discard the index lock too soon

pull/835/head
Raphaël Vinot 2023-11-21 16:50:15 +01:00
parent 9b2a9388d1
commit 89dbef8683
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ class BackgroundIndexer(AbstractManager):
self.logger.info(f'Build pickle for {uuid}: {path.name}')
self.lookyloo.get_crawled_tree(uuid)
self.lookyloo.trigger_modules(uuid, auto_trigger=True)
self.logger.info(f'Pickle for {uuid} build.')
self.logger.info(f'Pickle for {uuid} built.')
got_new_captures = True
max_captures -= 1
except MissingUUID:
@ -120,7 +120,7 @@ class BackgroundIndexer(AbstractManager):
def _check_indexes(self):
index_redis = self.lookyloo.indexing.redis
can_index = index_redis.set('ongoing_indexing', 1, ex=300, nx=True)
can_index = index_redis.set('ongoing_indexing', 1, ex=3600, nx=True)
if not can_index:
# There is no reason to run this method in multiple scripts.
self.logger.info('Indexing already ongoing in another process.')