mirror of https://github.com/langgenius/dify.git
fix: avoid closing shared session during embeddings (#26830)
This commit is contained in:
parent
c6a90d4bb3
commit
150a8276b9
|
|
@ -43,8 +43,7 @@ class CacheEmbedding(Embeddings):
|
|||
else:
|
||||
embedding_queue_indices.append(i)
|
||||
|
||||
# release database connection, because embedding may take a long time
|
||||
db.session.close()
|
||||
# NOTE: avoid closing the shared scoped session here; downstream code may still have pending work
|
||||
|
||||
if embedding_queue_indices:
|
||||
embedding_queue_texts = [texts[i] for i in embedding_queue_indices]
|
||||
|
|
|
|||
Loading…
Reference in New Issue