mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 21:37:33 +08:00
Fix: /file2document/convert blocks event loop on large folders causing 504 timeout (#13784)
Problem The /file2document/convert endpoint ran all file lookups, document deletions, and insertions synchronously inside the request cycle. Linking a large folder (~1.7GB with many files) caused 504 Gateway Timeout because the blocking DB loop held the HTTP connection open for too long. Fix - Extracted the heavy DB work into a plain sync function _convert_files - Inputs are validated and folder file IDs expanded upfront (fast path) - The blocking work is dispatched to a thread pool via get_running_loop().run_in_executor() and the endpoint returns 200 immediately - Frontend only checks data.code === 0 so the response change (file2documents list → True) has no impact Fixes #13781 --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
e705ac6643
commit
ff92b5575b
@@ -230,7 +230,7 @@ def _load_user_app(monkeypatch):
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def get_api_key(tenant_id, model_name):
|
||||
def get_api_key(tenant_id, model_name, model_type=None):
|
||||
return _MockTableObject(
|
||||
id=1,
|
||||
tenant_id=tenant_id,
|
||||
|
||||
Reference in New Issue
Block a user