chore: Remove unnecessary retry_connection calls in Database class when trying write access

This commit is contained in:
Théophile Diot 2024-05-29 15:19:08 +01:00
parent e4750efb0f
commit 713f7a1bf9
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -224,13 +224,11 @@ class Database:
def test_write(self):
"""Test the write access to the database"""
self.logger.debug("Testing write access to the database ...")
self.retry_connection(pool_timeout=1)
with self.__db_session() as session:
table_name = uuid4().hex
session.execute(text(f"CREATE TABLE IF NOT EXISTS test_{table_name} (id INT)"))
session.execute(text(f"DROP TABLE IF EXISTS test_{table_name}"))
session.commit()
self.retry_connection()
def retry_connection(self, *, readonly: bool = False, fallback: bool = False, log: bool = True, **kwargs) -> None:
"""Retry the connection to the database"""