fix(storage): Prevent AttributeError when closing uninitialized Postgres engine
This commit is contained in:
@@ -202,7 +202,8 @@ class Storage(Postgres, MinioManager):
|
|||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
"""Close Storage resources (MinIO client and Postgres engine)."""
|
"""Close Storage resources (MinIO client and Postgres engine)."""
|
||||||
Postgres.close(self)
|
if hasattr(self, 'engine'):
|
||||||
|
Postgres.close(self)
|
||||||
MinioManager.close(self)
|
MinioManager.close(self)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user