### What problem does this PR solve? https://github.com/infiniflow/ragflow/issues/8995 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>tags/v0.20.0
| @@ -18,10 +18,8 @@ | |||
| import logging | |||
| import os | |||
| import json | |||
| from flask import request | |||
| from peewee import OperationalError | |||
| from api import settings | |||
| from api.db import FileSource, StatusEnum | |||
| from api.db.db_models import File | |||
| @@ -526,4 +524,4 @@ def delete_knowledge_graph(tenant_id,dataset_id): | |||
| _, kb = KnowledgebaseService.get_by_id(dataset_id) | |||
| settings.docStoreConn.delete({"knowledge_graph_kwd": ["graph", "subgraph", "entity", "relation"]}, search.index_name(kb.tenant_id), dataset_id) | |||
| return get_result(data=True) | |||
| return get_result(data=True) | |||
| @@ -229,8 +229,10 @@ class DocumentService(CommonService): | |||
| @classmethod | |||
| @DB.connection_context() | |||
| def remove_document(cls, doc, tenant_id): | |||
| from api.db.services.task_service import TaskService | |||
| cls.clear_chunk_num(doc.id) | |||
| try: | |||
| TaskService.filter_delete(Task.doc_id == doc.id) | |||
| page = 0 | |||
| page_size = 1000 | |||
| all_chunk_ids = [] | |||