diff --git a/internal/autoreply/queue.go b/internal/autoreply/queue.go index 60dae1f..6f77aa6 100644 --- a/internal/autoreply/queue.go +++ b/internal/autoreply/queue.go @@ -92,13 +92,15 @@ func (q *DBMessageQueue) MarkAsProcessing(id uint64) error { return q.db.Model(&llmMessageQueueRecord{}).Where("id = ?", id).Update("status", statusProcessing).Error } -// MarkAsProcessed marks a message as successfully processed +// MarkAsProcessed marks a message as successfully processed and soft-deletes it +// 处理完成的消息直接软删除,避免队列页堆积;保留 reply/processed_at 便于查询历史 func (q *DBMessageQueue) MarkAsProcessed(id uint64, reply string) error { now := time.Now() return q.db.Model(&llmMessageQueueRecord{}).Where("id = ?", id).Updates(map[string]any{ - "status": statusProcessed, - "reply": reply, + "status": statusProcessed, + "reply": reply, "processed_at": &now, + "deleted_at": &now, }).Error } diff --git a/meshmap_frontend/src/components/AdminLLM.vue b/meshmap_frontend/src/components/AdminLLM.vue index af88f07..a6e479f 100644 --- a/meshmap_frontend/src/components/AdminLLM.vue +++ b/meshmap_frontend/src/components/AdminLLM.vue @@ -298,9 +298,14 @@ onMounted(() => {