feat: 更新文件索引状态处理逻辑
- 在 knowledgebase.py 中将文件索引失败时的状态更新为 "pending_indexing"。 - 在 DataBaseInfoView.vue 中调整条件判断,允许在文件状态为 "pending_indexing" 或 "failed" 时显示操作按钮。
This commit is contained in:
parent
c90e2e0b26
commit
3e64a4249b
@ -502,7 +502,7 @@ class KnowledgeBase:
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"文件 {file_id} 索引过程中发生错误: {e}, {traceback.format_exc()}")
|
logger.error(f"文件 {file_id} 索引过程中发生错误: {e}, {traceback.format_exc()}")
|
||||||
self.update_file_status(file_id, "failed")
|
self.update_file_status(file_id, "pending_indexing")
|
||||||
return {"status": "failed", "message": f"索引失败: {str(e)}"}
|
return {"status": "failed", "message": f"索引失败: {str(e)}"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -211,7 +211,7 @@
|
|||||||
|
|
||||||
<div v-else-if="column.key === 'action'" style="display: flex; gap: 10px;">
|
<div v-else-if="column.key === 'action'" style="display: flex; gap: 10px;">
|
||||||
<a-button
|
<a-button
|
||||||
v-if="record.status === 'pending_indexing'"
|
v-if="record.status === 'pending_indexing' || record.status === 'failed'"
|
||||||
type="link"
|
type="link"
|
||||||
@click="handleIndexFile(record.file_id)"
|
@click="handleIndexFile(record.file_id)"
|
||||||
:loading="state.indexingFile === record.file_id"
|
:loading="state.indexingFile === record.file_id"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user