RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
PY: refactor (#19599)
Jin Hai7218db7557f0
diff --git a/api/apps/restful_apis/document_api.py b/api/apps/restful_apis/document_api.pyindex 10e477181a..7a9fd9616c 100644--- a/api/apps/restful_apis/document_api.py+++ b/api/apps/restful_apis/document_api.py@@ -1858,7 +1858,8 @@ async def get_document_image(image_id):return get_data_error_result(message="Image not found.")bkt, nm = parseddata = await thread_pool_exec(settings.STORAGE_IMPL.get, bkt, nm)- if not data:+ if data is None:+ logging.warning("get_document_image: storage miss image_id: %s, bucket: %s, key: %s", image_id, bkt, nm)return get_data_error_result(message="Image not found.")content_type = _content_type_for_document_image(nm, data)response = await make_response(data)@@ -2110,8 +2111,9 @@ async def get(doc_id):b, n = File2DocumentService.get_storage_address(doc_id=doc_id)data = await thread_pool_exec(settings.STORAGE_IMPL.get, b, n)- if not data:- return get_data_error_result(message="This file is empty.")+ if data is None:+ logging.warning("get document preview: storage miss doc_id: %s, bucket: %s, key: %s", doc_id, b, n)+ return get_data_error_result(message="Document not found!")response = await make_response(data)ext = re.search(r"\.([^.]+)$", doc.name.lower())