1
This commit is contained in:
@@ -3,6 +3,7 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"rag-local/kb/consts"
|
||||
"rag-local/kb/model/dto"
|
||||
"rag-local/kb/service"
|
||||
)
|
||||
@@ -48,9 +49,9 @@ func (c *document) Delete(ctx context.Context, req *dto.DeleteDocumentReq) (*dto
|
||||
}
|
||||
|
||||
func (c *document) Reembed(ctx context.Context, req *dto.ReembedDocumentReq) (*dto.ReembedDocumentRes, error) {
|
||||
n, err := service.DocumentService.Reembed(ctx, req.Id)
|
||||
if err != nil {
|
||||
// 入队由轮询器串行消费,避免同步重算阻塞 HTTP 且无法展示过程状态;已排队/处理中会跳过
|
||||
if err := service.ParseTaskService.Enqueue(ctx, req.Id, consts.TaskTypeReembed); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dto.ReembedDocumentRes{Count: n}, nil
|
||||
return &dto.ReembedDocumentRes{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user