Properly close PGVector DB connection during shutdown()

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang 2025-02-02 20:39:18 -05:00
parent ccf0cbb903
commit 3444b32091
No known key found for this signature in database

View file

@ -158,7 +158,9 @@ class PGVectorVectorDBAdapter(VectorIO, VectorDBsProtocolPrivate):
raise RuntimeError("Could not connect to PGVector database server") from e
async def shutdown(self) -> None:
pass
if self.conn is not None:
self.conn.close()
log.info("Connection to PGVector database server closed")
async def register_vector_db(self, vector_db: VectorDB) -> None:
upsert_models(self.cursor, [(vector_db.identifier, vector_db)])