move db error handling from per-page to base page
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user