Properly close PGVector DB connection during shutdown() (#931)

The connection to the DB was not closed during shutdown.

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang 2025-02-03 00:23:13 -05:00 committed by GitHub
parent ccf0cbb903
commit 83a51c7bfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)])