Update knowledge.py (#19434)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from fastapi import APIRouter, Depends, HTTPException, status, Request, Query
|
from fastapi import APIRouter, Depends, HTTPException, status, Request, Query
|
||||||
|
from fastapi.concurrency import run_in_threadpool
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from open_webui.models.knowledge import (
|
from open_webui.models.knowledge import (
|
||||||
@@ -223,7 +224,8 @@ async def reindex_knowledge_files(request: Request, user=Depends(get_verified_us
|
|||||||
failed_files = []
|
failed_files = []
|
||||||
for file in files:
|
for file in files:
|
||||||
try:
|
try:
|
||||||
process_file(
|
await run_in_threadpool(
|
||||||
|
process_file,
|
||||||
request,
|
request,
|
||||||
ProcessFileForm(
|
ProcessFileForm(
|
||||||
file_id=file.id, collection_name=knowledge_base.id
|
file_id=file.id, collection_name=knowledge_base.id
|
||||||
|
|||||||
Reference in New Issue
Block a user