move db error handling from per-page to base page

This commit is contained in:
David Rodenkirchen
2024-08-29 13:25:20 +02:00
parent 140d1cb1db
commit deae96d8fa
4 changed files with 17 additions and 8 deletions
@@ -36,9 +36,12 @@ class DatabaseService:
self._connection: Optional[mariadb.Connection] = None
self._reestablishment_lock = False
self.establish_new_connection()
self.calls = 0
@property
def is_connected(self) -> bool:
self.calls += 1
print(f"{self.calls} Calls")
try:
self._connection.ping()
except Exception: