chg: avoid trying to load a tree that is currenly being built

pull/803/head
Raphaël Vinot 2023-10-13 20:08:58 +02:00
parent 74bc8fcdd5
commit 4143d5f249
1 changed files with 2 additions and 0 deletions

View File

@ -95,6 +95,8 @@ class CaptureCache():
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)