fix(storage): Prevent AttributeError when closing uninitialized Postgres engine

This commit is contained in:
Bruno Domingues
2026-08-04 14:57:52 -03:00
parent 35efb67c89
commit 773c980fc3

View File

@@ -202,7 +202,8 @@ class Storage(Postgres, MinioManager):
def close(self) -> None:
"""Close Storage resources (MinIO client and Postgres engine)."""
Postgres.close(self)
if hasattr(self, 'engine'):
Postgres.close(self)
MinioManager.close(self)
def __del__(self):