Refactor
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
parent
db5a30b2cb
commit
c821dc0eae
3 changed files with 6 additions and 3 deletions
|
|
@ -308,7 +308,7 @@ def get_filter():
|
||||||
|
|
||||||
@manager.route("/infos", methods=["POST"]) # noqa: F821
|
@manager.route("/infos", methods=["POST"]) # noqa: F821
|
||||||
@login_required
|
@login_required
|
||||||
def docinfos():
|
def doc_infos():
|
||||||
req = request.json
|
req = request.json
|
||||||
doc_ids = req["doc_ids"]
|
doc_ids = req["doc_ids"]
|
||||||
for doc_id in doc_ids:
|
for doc_id in doc_ids:
|
||||||
|
|
@ -544,6 +544,7 @@ def change_parser():
|
||||||
return get_data_error_result(message="Tenant not found!")
|
return get_data_error_result(message="Tenant not found!")
|
||||||
if settings.docStoreConn.indexExist(search.index_name(tenant_id), doc.kb_id):
|
if settings.docStoreConn.indexExist(search.index_name(tenant_id), doc.kb_id):
|
||||||
settings.docStoreConn.delete({"doc_id": doc.id}, search.index_name(tenant_id), doc.kb_id)
|
settings.docStoreConn.delete({"doc_id": doc.id}, search.index_name(tenant_id), doc.kb_id)
|
||||||
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if "pipeline_id" in req and req["pipeline_id"] != "":
|
if "pipeline_id" in req and req["pipeline_id"] != "":
|
||||||
|
|
|
||||||
|
|
@ -246,8 +246,8 @@ def rm():
|
||||||
try:
|
try:
|
||||||
if file.location:
|
if file.location:
|
||||||
settings.STORAGE_IMPL.rm(file.parent_id, file.location)
|
settings.STORAGE_IMPL.rm(file.parent_id, file.location)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
logging.exception(f"Fail to remove object: {file.parent_id}/{file.location}")
|
logging.exception(f"Fail to remove object: {file.parent_id}/{file.location}, error: {e}")
|
||||||
|
|
||||||
informs = File2DocumentService.get_by_file_id(file.id)
|
informs = File2DocumentService.get_by_file_id(file.id)
|
||||||
for inform in informs:
|
for inform in informs:
|
||||||
|
|
|
||||||
|
|
@ -731,6 +731,8 @@ def delete_kb_task():
|
||||||
def cancel_task(task_id):
|
def cancel_task(task_id):
|
||||||
REDIS_CONN.set(f"{task_id}-cancel", "x")
|
REDIS_CONN.set(f"{task_id}-cancel", "x")
|
||||||
|
|
||||||
|
kb_task_id_field: str = ""
|
||||||
|
kb_task_finish_at: str = ""
|
||||||
match pipeline_task_type:
|
match pipeline_task_type:
|
||||||
case PipelineTaskType.GRAPH_RAG:
|
case PipelineTaskType.GRAPH_RAG:
|
||||||
kb_task_id_field = "graphrag_task_id"
|
kb_task_id_field = "graphrag_task_id"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue