mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-30 23:26:36 +08:00
Feat: process memory (#12445)
### What problem does this PR solve? Add task status for raw message, and move extract message as a nested property under raw message ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -179,6 +179,40 @@ class TaskService(CommonService):
|
||||
return None
|
||||
return tasks
|
||||
|
||||
@classmethod
|
||||
@DB.connection_context()
|
||||
def get_tasks_progress_by_doc_ids(cls, doc_ids: list[str]):
|
||||
"""Retrieve all tasks associated with specific documents.
|
||||
|
||||
This method fetches all processing tasks for given document ids, ordered by
|
||||
creation time. It includes task progress and chunk information.
|
||||
|
||||
Args:
|
||||
doc_ids (str): The unique identifier of the document.
|
||||
|
||||
Returns:
|
||||
list[dict]: List of task dictionaries containing task details.
|
||||
Returns None if no tasks are found.
|
||||
"""
|
||||
fields = [
|
||||
cls.model.id,
|
||||
cls.model.doc_id,
|
||||
cls.model.from_page,
|
||||
cls.model.progress,
|
||||
cls.model.progress_msg,
|
||||
cls.model.digest,
|
||||
cls.model.chunk_ids,
|
||||
cls.model.create_time
|
||||
]
|
||||
tasks = (
|
||||
cls.model.select(*fields).order_by(cls.model.create_time.desc())
|
||||
.where(cls.model.doc_id.in_(doc_ids))
|
||||
)
|
||||
tasks = list(tasks.dicts())
|
||||
if not tasks:
|
||||
return None
|
||||
return tasks
|
||||
|
||||
@classmethod
|
||||
@DB.connection_context()
|
||||
def update_chunk_ids(cls, id: str, chunk_ids: str):
|
||||
|
||||
Reference in New Issue
Block a user