mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
Merge pull request #13232
* PGVector needs to close its connection if its garbage collected
This commit is contained in:
parent
85a77d2c27
commit
1726d5dcdd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user