chg: Move uwhois request to background.

pull/1009/head
Raphaël Vinot 2024-12-04 16:17:09 +01:00
parent ee5a901003
commit d4f04f1b53
No known key found for this signature in database
GPG Key ID: 32E4E1C133B3792F
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -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: