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
Refactor: make page number readable (#18409)
Wang Qi75f737de676b
diff --git a/api/db/services/task_service.py b/api/db/services/task_service.pyindex d8f9699ea0..462dad63ce 100644--- a/api/db/services/task_service.py+++ b/api/db/services/task_service.py@@ -584,12 +584,8 @@ def reuse_prev_task_chunks(task: dict, prev_tasks: list[dict], chunking_config:return 0task["chunk_ids"] = prev_task["chunk_ids"]task["progress"] = 1.0- if (- "from_page" in task- and "to_page" in task- and (int(task["to_page"]) - int(task["from_page"]) >= 10**6 or (int(task["from_page"]) == MAXIMUM_TASK_PAGE_NUMBER and int(task["to_page"]) == MAXIMUM_TASK_PAGE_NUMBER))- ):- task["progress_msg"] = f"Page({task['from_page']}~{task['to_page']}): "+ if "from_page" in task and "to_page" in task and int(task["to_page"]) - int(task["from_page"]) >= 10**6:+ task["progress_msg"] = f"Page({int(task['from_page']) + 1}~{int(task['to_page'])}): "else:task["progress_msg"] = ""task["progress_msg"] = " ".join([datetime.now().strftime("%H:%M:%S"), task["progress_msg"], "Reused previous task's chunks."])diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.pyindex 23db1fab30..0ad83449fe 100644--- a/rag/svr/task_executor.py+++ b/rag/svr/task_executor.py@@ -196,7 +196,7 @@ def set_progress(task_id, from_page=0, to_page=-1, prog=None, msg="Processing...if to_page > 0:if msg:if from_page < to_page:- msg = f"Page({from_page + 1}~{to_page + 1}): " + msg+ msg = f"Page({from_page + 1}~{to_page}): " + msgif msg:msg = datetime.now().strftime("%H:%M:%S") + " " + msgd = {"progress_msg": msg}