From d4f04f1b53f578339958ca186671c1c1d1490941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 4 Dec 2024 16:17:09 +0100 Subject: [PATCH] chg: Move uwhois request to background. --- bin/background_build_captures.py | 5 ++++- website/web/__init__.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/background_build_captures.py b/bin/background_build_captures.py index 0f58fe34..9152c6f4 100755 --- a/bin/background_build_captures.py +++ b/bin/background_build_captures.py @@ -116,11 +116,14 @@ class BackgroundBuildCaptures(AbstractManager): try: self.logger.info(f'Build pickle for {uuid}: {path.name}') - self.lookyloo.get_crawled_tree(uuid) + ct = self.lookyloo.get_crawled_tree(uuid) try: self.lookyloo.trigger_modules(uuid, auto_trigger=True, force=False, as_admin=False) except Exception as e: self.logger.exception(f'Unable to trigger modules for {uuid}: {e}') + # Trigger whois request on all nodes + for node in ct.root_hartree.hostname_tree.traverse(): + self.lookyloo.uwhois.query_whois_hostnode(node) self.logger.info(f'Pickle for {uuid} built.') got_new_captures = True max_captures -= 1 diff --git a/website/web/__init__.py b/website/web/__init__.py index b7e2a8cb..2fc5c127 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -518,7 +518,6 @@ def get_hostnode_investigator(capture_uuid: str, /, node_uuid: str) -> tuple[Hos hostnode = ct.root_hartree.get_host_node_by_uuid(node_uuid) known_content = lookyloo.context.find_known_content(hostnode) - lookyloo.uwhois.query_whois_hostnode(hostnode) urls: list[dict[str, Any]] = [] for url in hostnode.urls: