mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-24 05:50:18 +00:00
Merge pull request #13232
* PGVector needs to close its connection if its garbage collected
This commit is contained in:
@@ -147,6 +147,10 @@ class PGVector(VectorStore):
|
||||
self.create_tables_if_not_exists()
|
||||
self.create_collection()
|
||||
|
||||
def __del__(self) -> None:
|
||||
if self._conn:
|
||||
self._conn.close()
|
||||
|
||||
@property
|
||||
def embeddings(self) -> Embeddings:
|
||||
return self.embedding_function
|
||||
|
||||
Reference in New Issue
Block a user