From a7bbb1a7e0c9e5f018f7a70210dcc1787fa96936 Mon Sep 17 00:00:00 2001 From: Roman Lozko Date: Thu, 5 Dec 2024 20:38:00 +0000 Subject: [PATCH] Remove timeouts from db connection --- conan/internal/cache/db/table.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/conan/internal/cache/db/table.py b/conan/internal/cache/db/table.py index 5ad675ad68f..368dfeeb7b9 100644 --- a/conan/internal/cache/db/table.py +++ b/conan/internal/cache/db/table.py @@ -23,13 +23,12 @@ def __init__(self, filename): @contextmanager def db_connection(self): - assert self._lock.acquire(timeout=10), "Conan failed to acquire database lock" - connection = sqlite3.connect(self.filename, isolation_level=None, timeout=10) - try: - yield connection - finally: - connection.close() - self._lock.release() + with self._lock: + connection = sqlite3.connect(self.filename, isolation_level=None) + try: + yield connection + finally: + connection.close() def create_table(self): def field(name, typename, nullable=False, check_constraints: Optional[List] = None,