From 1e59faf24dbfbe292e4bdcf2f2225af53535e220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 25 Sep 2024 12:28:30 +0200 Subject: [PATCH] fix: return 0 instead of a list in counters --- lookyloo/indexing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lookyloo/indexing.py b/lookyloo/indexing.py index 621a4f34..c3a53e9b 100644 --- a/lookyloo/indexing.py +++ b/lookyloo/indexing.py @@ -465,7 +465,7 @@ class Indexing(): if self.redis.type(f'urls|{md5}|captures') == 'set': # type: ignore[no-untyped-call] # triggers the re-index soon. self.redis.srem('indexed_urls', *self.redis.smembers(f'urls|{md5}|captures')) - return [] + return 0 return self.redis.zcard(f'urls|{md5}|captures') def get_captures_hostname(self, hostname: str, most_recent_capture: datetime | None = None, @@ -488,7 +488,7 @@ class Indexing(): if self.redis.type(f'hostnames|{hostname}|captures') == 'set': # type: ignore[no-untyped-call] # triggers the re-index soon. self.redis.srem('indexed_urls', *self.redis.smembers(f'hostnames|{hostname}|captures')) - return [] + return 0 return self.redis.zcard(f'hostnames|{hostname}|captures') def get_capture_url_counter(self, capture_uuid: str, url: str) -> int: