From 393a598d77805ec0cd25da1e273f038cb685b5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 7 Oct 2024 18:36:46 +0200 Subject: [PATCH] fix: Properly cleanup the HHHashes global index. --- lookyloo/indexing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lookyloo/indexing.py b/lookyloo/indexing.py index 6c1f52d7..246cc744 100644 --- a/lookyloo/indexing.py +++ b/lookyloo/indexing.py @@ -328,7 +328,7 @@ class Indexing(): # We changed the format of the indexes, so we need to make sure they're re-triggered. pipeline = self.redis.pipeline() if self.redis.type(f'hhhashes|{hhh}|captures') == 'set': # type: ignore[no-untyped-call] - pipeline.srem('indexed_hhhashes', *self.redis.smembers(f'hhhashes|{hhh}|captures')) + pipeline.srem('indexed_hhhashes', *[entry.split('|')[0] for entry in self.redis.smembers(f'hhhashes|{hhh}|captures')]) pipeline.delete(f'hhhashes|{hhh}|captures') if self.redis.type('hhhashes') == 'zset': # type: ignore[no-untyped-call] pipeline.delete('hhhashes') @@ -346,7 +346,7 @@ class Indexing(): self.logger.debug(f'Indexing HHHashes for {crawled_tree.uuid} ... ') pipeline = self.redis.pipeline() - # Add the tlds key in internal indexes set + # Add the hhashes key in internal indexes set internal_index = f'capture_indexes|{crawled_tree.uuid}' pipeline.sadd(internal_index, 'hhhashes')