Fix: upload document might be hung the whole ragflow (#17537)

This commit is contained in:
Wang Qi
2026-07-30 13:54:07 +08:00
committed by GitHub
parent cb908d1979
commit 6e0e495929
3 changed files with 108 additions and 75 deletions

View File

@@ -519,7 +519,11 @@ async def _upload_web_document(dataset_id, kb, tenant_id):
if not is_valid_url(url):
return get_error_data_result(message="The URL format is invalid", code=RetCode.ARGUMENT_ERROR)
blob = html2pdf(url)
try:
blob = await thread_pool_exec(html2pdf, url)
except Exception as e:
logging.warning("html2pdf failed for %s, %s", dataset_id, str(e))
return get_error_data_result(message=str(e), code=RetCode.SERVER_ERROR)
if not blob:
return server_error_response(ValueError("Download failure."))