fix: async save docs to vector db

This commit is contained in:
Timothy Jaeryang Baek
2025-11-25 17:19:33 -05:00
parent c631659327
commit 4370dee79e

View File

@@ -1689,7 +1689,7 @@ async def process_text(
log.debug(f"text_content: {text_content}") log.debug(f"text_content: {text_content}")
result = await run_in_threadpool( result = await run_in_threadpool(
save_docs_to_vector_db, request, docs, collection_name, user save_docs_to_vector_db, request, docs, collection_name, user=user
) )
if result: if result:
return { return {
@@ -1721,7 +1721,12 @@ async def process_web(
if not request.app.state.config.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL: if not request.app.state.config.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL:
await run_in_threadpool( await run_in_threadpool(
save_docs_to_vector_db, request, docs, collection_name, True, user save_docs_to_vector_db,
request,
docs,
collection_name,
overwrite=True,
user=user,
) )
else: else:
collection_name = None collection_name = None
@@ -2464,7 +2469,12 @@ async def process_files_batch(
if all_docs: if all_docs:
try: try:
await run_in_threadpool( await run_in_threadpool(
save_docs_to_vector_db, request, all_docs, collection_name, True, user save_docs_to_vector_db,
request,
all_docs,
collection_name,
add=True,
user=user,
) )
# Update all files with collection name # Update all files with collection name