Skip to content

Commit deb9bef

Browse files
committed
Fix dependency issue
1 parent 449ece9 commit deb9bef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

analysis/concurrent_knowledge.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ def _acquire_lock(self, timeout: float = 10.0) -> Any:
5050
try:
5151
portalocker.lock(lock_file, portalocker.LOCK_EX | portalocker.LOCK_NB)
5252
return lock_file
53-
except OSError:
53+
except (OSError, portalocker.exceptions.LockException) as exc:
54+
# Retry until timeout to handle concurrent access across processes
5455
if time.time() - start_time > timeout:
5556
lock_file.close()
56-
raise TimeoutError(f"Lock timeout: {self.file_path}")
57+
raise TimeoutError(f"Lock timeout: {self.file_path}") from exc
5758
time.sleep(0.05)
5859

5960
def _release_lock(self, lock_file: Any):

0 commit comments

Comments
 (0)