From 4143d5f249b6c567f0b1f96b53807d890a2e7f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 13 Oct 2023 20:08:58 +0200 Subject: [PATCH] chg: avoid trying to load a tree that is currenly being built --- lookyloo/capturecache.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lookyloo/capturecache.py b/lookyloo/capturecache.py index 3ae8f8aa..c45cd277 100644 --- a/lookyloo/capturecache.py +++ b/lookyloo/capturecache.py @@ -95,6 +95,8 @@ def __init__(self, cache_entry: Dict[str, Any]): def tree(self) -> CrawledTree: if not self.capture_dir.exists(): raise MissingCaptureDirectory(f'The capture {self.uuid} does not exists in {self.capture_dir}.') + while is_locked(self.capture_dir): + time.sleep(5) return load_pickle_tree(self.capture_dir, self.capture_dir.stat().st_mtime, self.logger)