Skip to content

Commit 2cfb5e6

Browse files
committed
using clientId and codebasePath as tenantId
1 parent 24f9945 commit 2cfb5e6

File tree

14 files changed

+105
-184
lines changed

14 files changed

+105
-184
lines changed

internal/job/embedding.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func (t *embeddingProcessor) Process(ctx context.Context) error {
137137
})
138138
}
139139
err := t.svcCtx.VectorStore.DeleteCodeChunks(ctx, deleteChunks, vector.Options{
140+
ClientId: t.params.ClientId,
140141
CodebaseId: t.params.CodebaseID,
141142
CodebasePath: t.params.CodebasePath,
142143
CodebaseName: t.params.CodebaseName,
@@ -153,6 +154,7 @@ func (t *embeddingProcessor) Process(ctx context.Context) error {
153154
// 批量处理结果
154155
if len(addChunks) > 0 {
155156
err := t.svcCtx.VectorStore.UpsertCodeChunks(ctx, addChunks, vector.Options{
157+
ClientId: t.params.ClientId,
156158
CodebaseId: t.params.CodebaseID,
157159
CodebasePath: t.params.CodebasePath,
158160
CodebaseName: t.params.CodebaseName,

internal/logic/codebase_tree.go

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,9 @@ func (l *CodebaseTreeLogic) GetCodebaseTree(req *types.CodebaseTreeRequest) (*ty
3636
}
3737
log.Printf("[DEBUG] 参数验证通过")
3838

39-
// 权限验证
40-
codebaseId, err := l.verifyCodebasePermission(req)
41-
if err != nil {
42-
log.Printf("[DEBUG] 权限验证失败: %v", err)
43-
return nil, errs.FileNotFound
44-
}
45-
log.Printf("[DEBUG] 权限验证通过,获得 codebaseId: %d", codebaseId)
46-
4739
// 构建目录树
4840
log.Printf("[DEBUG] 开始构建目录树...")
49-
tree, err := l.buildDirectoryTree(codebaseId, req)
41+
tree, err := l.buildDirectoryTree(req.ClientId, req)
5042
if err != nil {
5143
log.Printf("[DEBUG] 构建目录树失败: %v", err)
5244
return nil, fmt.Errorf("构建目录树失败: %w", err)
@@ -87,40 +79,6 @@ func (l *CodebaseTreeLogic) validateRequest(req *types.CodebaseTreeRequest) erro
8779
return nil
8880
}
8981

90-
func (l *CodebaseTreeLogic) verifyCodebasePermission(req *types.CodebaseTreeRequest) (int32, error) {
91-
// 添加调试日志
92-
log.Printf("[DEBUG] verifyCodebasePermission - 开始权限验证")
93-
log.Printf("[DEBUG] verifyCodebasePermission - ClientId: %s", req.ClientId)
94-
log.Printf("[DEBUG] verifyCodebasePermission - CodebasePath: %s", req.CodebasePath)
95-
log.Printf("[DEBUG] verifyCodebasePermission - CodebaseName: %s", req.CodebaseName)
96-
97-
// 检查是否应该根据 ClientId 和 CodebasePath 从数据库查询真实的 codebaseId
98-
log.Printf("[DEBUG] verifyCodebasePermission - 检查数据库中是否存在匹配的 codebase 记录")
99-
100-
// 尝试根据 ClientId 和 CodebasePath 查询真实的 codebase
101-
codebase, err := l.svcCtx.Querier.Codebase.WithContext(l.ctx).
102-
Where(l.svcCtx.Querier.Codebase.ClientID.Eq(req.ClientId)).
103-
Where(l.svcCtx.Querier.Codebase.ClientPath.Eq(req.CodebasePath)).
104-
First()
105-
106-
if err != nil {
107-
log.Printf("[DEBUG] verifyCodebasePermission - 数据库查询失败或未找到匹配记录: %v", err)
108-
log.Printf("[DEBUG] verifyCodebasePermission - 将使用模拟的 codebaseId: 1")
109-
// 这里应该实现实际的权限验证逻辑
110-
// 由于是MVP版本,我们暂时返回一个模拟的ID
111-
codebaseId := int32(1)
112-
log.Printf("[DEBUG] verifyCodebasePermission - 返回模拟 codebaseId: %d", codebaseId)
113-
return codebaseId, nil
114-
}
115-
116-
log.Printf("[DEBUG] verifyCodebasePermission - 找到匹配的 codebase 记录")
117-
log.Printf("[DEBUG] verifyCodebasePermission - 数据库记录 ID: %d, Name: %s, Status: %s",
118-
codebase.ID, codebase.Name, codebase.Status)
119-
120-
log.Printf("[DEBUG] verifyCodebasePermission - 返回真实的 codebaseId: %d", codebase.ID)
121-
return codebase.ID, nil
122-
}
123-
12482
// printTreeStructure 递归打印树结构
12583
func (l *CodebaseTreeLogic) printTreeStructure(tree *types.TreeNode) {
12684
// 递归打印树结构
@@ -138,15 +96,12 @@ func (l *CodebaseTreeLogic) printTreeStructure(tree *types.TreeNode) {
13896
printTree(tree, "")
13997
}
14098

141-
func (l *CodebaseTreeLogic) buildDirectoryTree(codebaseId int32, req *types.CodebaseTreeRequest) (*types.TreeNode, error) {
99+
func (l *CodebaseTreeLogic) buildDirectoryTree(clientId string, req *types.CodebaseTreeRequest) (*types.TreeNode, error) {
142100
log.Printf("[DEBUG] ===== buildDirectoryTree 开始执行 =====")
143-
log.Printf("[DEBUG] 输入参数: codebaseId=%d, codebasePath=%s", codebaseId, req.CodebasePath)
144-
145-
// 检查数据库中是否存在该 codebaseId
146-
l.checkCodebaseInDatabase(codebaseId)
101+
log.Printf("[DEBUG] 输入参数: clientId=%s, codebasePath=%s", clientId, req.CodebasePath)
147102

148103
// 从向量存储中获取文件路径
149-
records, err := l.getRecordsFromVectorStore(codebaseId, req.CodebasePath)
104+
records, err := l.getRecordsFromVectorStore(clientId, req.CodebasePath)
150105
if err != nil {
151106
return nil, err
152107
}
@@ -191,18 +146,18 @@ func (l *CodebaseTreeLogic) checkCodebaseInDatabase(codebaseId int32) {
191146
}
192147

193148
// getRecordsFromVectorStore 从向量存储中获取文件记录
194-
func (l *CodebaseTreeLogic) getRecordsFromVectorStore(codebaseId int32, codebasePath string) ([]*types.CodebaseRecord, error) {
149+
func (l *CodebaseTreeLogic) getRecordsFromVectorStore(clientId string, codebasePath string) ([]*types.CodebaseRecord, error) {
195150
if l.svcCtx.VectorStore == nil {
196151
return nil, fmt.Errorf("VectorStore 未初始化")
197152
}
198153

199-
records, err := l.svcCtx.VectorStore.GetCodebaseRecords(l.ctx, codebaseId, codebasePath)
154+
records, err := l.svcCtx.VectorStore.GetCodebaseRecords(l.ctx, clientId, codebasePath)
200155
if err != nil {
201156
return nil, fmt.Errorf("查询文件路径失败: %w", err)
202157
}
203158

204159
if len(records) == 0 {
205-
l.logEmptyRecordsDiagnostic(codebaseId, codebasePath)
160+
l.logEmptyRecordsDiagnostic(clientId, codebasePath)
206161
}
207162

208163
// 合并相同文件路径的记录
@@ -281,7 +236,7 @@ func (l *CodebaseTreeLogic) mergeSingleFileRecords(records []*types.CodebaseReco
281236
}
282237

283238
// logEmptyRecordsDiagnostic 记录空记录的诊断信息
284-
func (l *CodebaseTreeLogic) logEmptyRecordsDiagnostic(codebaseId int32, codebasePath string) {
239+
func (l *CodebaseTreeLogic) logEmptyRecordsDiagnostic(clientId string, codebasePath string) {
285240
// 详细诊断:检查数据库和向量存储的连接状态
286241
log.Printf("[DEBUG] ===== 深度诊断:数据库和向量存储状态检查 =====")
287242

@@ -307,7 +262,7 @@ func (l *CodebaseTreeLogic) logEmptyRecordsDiagnostic(codebaseId int32, codebase
307262
log.Printf("[DEBUG] 3. 尝试查询向量存储中的所有记录...")
308263
if l.svcCtx.VectorStore != nil {
309264
// 尝试使用一个空的 codebasePath 来获取所有记录
310-
allRecords, err := l.svcCtx.VectorStore.GetCodebaseRecords(l.ctx, codebaseId, "")
265+
allRecords, err := l.svcCtx.VectorStore.GetCodebaseRecords(l.ctx, clientId, "")
311266
if err != nil {
312267
log.Printf("[DEBUG] ❌ 查询所有向量存储记录失败: %v", err)
313268
} else {
@@ -323,7 +278,7 @@ func (l *CodebaseTreeLogic) logEmptyRecordsDiagnostic(codebaseId int32, codebase
323278

324279
// 4. 检查请求参数的详细情况
325280
log.Printf("[DEBUG] 4. 请求参数详细分析:")
326-
log.Printf("[DEBUG] codebaseId: %d (类型: %T)", codebaseId, codebaseId)
281+
log.Printf("[DEBUG] clientId: %s (类型: %T)", clientId, clientId)
327282
log.Printf("[DEBUG] req.CodebasePath: '%s' (长度: %d)", codebasePath, len(codebasePath))
328283
log.Printf("[DEBUG] req.CodebasePath 为空: %v", codebasePath == "")
329284
log.Printf("[DEBUG] req.CodebasePath 为 '.': %v", codebasePath == ".")

internal/logic/dictionary_records.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (l *DictionaryRecordsLogic) GetDictionaryRecords(req *types.DictionaryRecor
4242
}
4343

4444
// 查询目录记录
45-
records, err := queryStore.QueryDictionaryRecords(l.ctx, req.CodebasePath, req.Dictionary)
45+
records, err := queryStore.QueryDictionaryRecords(l.ctx, req.ClientId, req.CodebasePath, req.Dictionary)
4646
if err != nil {
4747
l.Errorf("查询目录记录失败, codebasePath: %s, dictionary: %s, error: %v", req.CodebasePath, req.Dictionary, err)
4848
return nil, fmt.Errorf("查询目录记录失败: %w", err)

internal/logic/embedding_task.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func (l *TaskLogic) SubmitTask(req *types.IndexTaskRequest, r *http.Request) (re
227227
// 执行重命名任务
228228
if len(renameTasks) > 0 {
229229
l.Logger.Infof("开始执行 %d 个重命名任务", len(renameTasks))
230-
if err := l.executeRenameTasks(ctx, codebase, renameTasks); err != nil {
230+
if err := l.executeRenameTasks(ctx, clientId, req.CodebasePath, renameTasks); err != nil {
231231
l.Logger.Errorf("执行重命名任务失败: %v", err)
232232
// 不返回错误,继续处理其他任务
233233
} else {
@@ -739,12 +739,12 @@ func (l *TaskLogic) getSyncMetadata() *types.SyncMetadata {
739739
}
740740

741741
// executeRenameTasks 执行重命名任务
742-
func (l *TaskLogic) executeRenameTasks(ctx context.Context, codebase *model.Codebase, renameTasks []types.FileListItem) error {
742+
func (l *TaskLogic) executeRenameTasks(ctx context.Context, clientId string, codebasePath string, renameTasks []types.FileListItem) error {
743743
for _, task := range renameTasks {
744744
l.Logger.Infof("开始执行重命名任务 - 源路径: %s, 目标路径: %s", task.Path, task.TargetPath)
745745

746746
// 更新向量数据库中的文件路径
747-
if err := l.renameFileInVectorDB(ctx, codebase, task.Path, task.TargetPath); err != nil {
747+
if err := l.renameFileInVectorDB(ctx, clientId, codebasePath, task.Path, task.TargetPath); err != nil {
748748
l.Logger.Errorf("重命名文件失败 - 源路径: %s, 目标路径: %s, 错误: %v",
749749
task.Path, task.TargetPath, err)
750750
return err
@@ -766,14 +766,14 @@ func (l *TaskLogic) executeRenameTasks(ctx context.Context, codebase *model.Code
766766
}
767767

768768
// renameFileInVectorDB 在向量数据库中重命名文件
769-
func (l *TaskLogic) renameFileInVectorDB(ctx context.Context, codebase *model.Codebase, sourcePath, targetPath string) error {
769+
func (l *TaskLogic) renameFileInVectorDB(ctx context.Context, clientId string, codebasePath string, sourcePath, targetPath string) error {
770770
l.Logger.Infof("开始执行向量数据库中的文件重命名 - 源路径: %s, 目标路径: %s", sourcePath, targetPath)
771771

772772
// 将文件路径转换为Linux格式(正斜杠)
773773
sourceLinuxPath := strings.ReplaceAll(sourcePath, "\\", "/")
774774
targetLinuxPath := strings.ReplaceAll(targetPath, "\\", "/")
775775

776-
l.svcCtx.VectorStore.UpdateCodeChunksDictionary(ctx, codebase.Path, sourceLinuxPath, targetLinuxPath)
776+
l.svcCtx.VectorStore.UpdateCodeChunksDictionary(ctx, clientId, codebasePath, sourceLinuxPath, targetLinuxPath)
777777

778778
return nil
779779
}

internal/logic/file_records.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (l *FileRecordsLogic) GetFileRecords(req *types.FileRecordsRequest) (*types
4242
}
4343

4444
// 查询文件记录
45-
records, err := queryStore.QueryFileRecords(l.ctx, req.CodebasePath, req.FilePath)
45+
records, err := queryStore.QueryFileRecords(l.ctx, req.ClientId, req.CodebasePath, req.FilePath)
4646
if err != nil {
4747
l.Errorf("查询文件记录失败, codebasePath: %s, filePath: %s, error: %v", req.CodebasePath, req.FilePath, err)
4848
return nil, fmt.Errorf("查询文件记录失败: %w", err)

internal/logic/index.go

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ package logic
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76

87
"github.com/zgsm-ai/codebase-indexer/internal/store/vector"
98
"github.com/zgsm-ai/codebase-indexer/internal/tracer"
109

11-
"github.com/zgsm-ai/codebase-indexer/internal/errs"
12-
"gorm.io/gorm"
13-
1410
"github.com/zgsm-ai/codebase-indexer/internal/svc"
1511
"github.com/zgsm-ai/codebase-indexer/internal/types"
1612

@@ -33,30 +29,20 @@ func NewIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IndexLogic
3329

3430
func (l *IndexLogic) DeleteIndex(req *types.DeleteIndexRequest) (resp *types.DeleteIndexResponseData, err error) {
3531
clientId := req.ClientId
36-
clientPath := req.CodebasePath
3732
filePaths := req.FilePaths
3833

39-
// 查找代码库记录
40-
codebase, err := l.svcCtx.Querier.Codebase.FindByClientIdAndPath(l.ctx, clientId, clientPath)
41-
if errors.Is(err, gorm.ErrRecordNotFound) {
42-
return nil, errs.NewRecordNotFoundErr(types.NameCodeBase, fmt.Sprintf("client_id: %s, clientPath: %s", clientId, clientPath))
43-
}
44-
if err != nil {
45-
return nil, err
46-
}
47-
48-
ctx := context.WithValue(l.ctx, tracer.Key, tracer.RequestTraceId(int(codebase.ID)))
34+
ctx := context.WithValue(l.ctx, tracer.Key, clientId)
4935

5036
// 如果filePaths为空,则删除整个工程的嵌入数据
5137
if filePaths == "" {
52-
if err = l.svcCtx.VectorStore.DeleteByCodebase(ctx, codebase.ID, codebase.Path); err != nil {
38+
if err = l.svcCtx.VectorStore.DeleteByCodebase(ctx, clientId, req.CodebasePath); err != nil {
5339
return nil, fmt.Errorf("failed to delete embedding codebase, err:%w", err)
5440
}
5541
return &types.DeleteIndexResponseData{}, nil
5642
}
5743

58-
if err = l.svcCtx.VectorStore.DeleteDictionary(ctx, filePaths, vector.Options{CodebaseId: codebase.ID,
59-
CodebasePath: codebase.Path}); err != nil {
44+
if err = l.svcCtx.VectorStore.DeleteDictionary(ctx, filePaths, vector.Options{ClientId: clientId,
45+
CodebasePath: req.CodebasePath}); err != nil {
6046
return nil, fmt.Errorf("failed to delete embedding index, err:%w", err)
6147
}
6248

internal/logic/query_codebase.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (l *QueryCodebaseLogic) QueryCodebase(req *types.CodebaseQueryRequest) (*ty
5858
done := make(chan bool, 1)
5959
go func() {
6060
// 获取汇总信息
61-
summary, queryErr = vectorStore.QueryCodebaseStats(l.ctx, codebaseInfo.ID, codebaseInfo.ClientPath)
61+
summary, queryErr = vectorStore.QueryCodebaseStats(l.ctx, req.ClientId, codebaseInfo.ClientPath)
6262
if queryErr != nil {
6363
done <- true
6464
return
@@ -86,7 +86,7 @@ func (l *QueryCodebaseLogic) QueryCodebase(req *types.CodebaseQueryRequest) (*ty
8686
}
8787

8888
// 获取详细记录
89-
records, queryErr = vectorStore.QueryCodebaseRecords(l.ctx, codebaseInfo.ID, codebaseInfo.ClientPath)
89+
records, queryErr = vectorStore.QueryCodebaseRecords(l.ctx, req.ClientId, codebaseInfo.ClientPath)
9090
done <- true
9191
}()
9292

internal/logic/summary.go

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ package logic
33
import (
44
"context"
55
"errors"
6-
"fmt"
7-
"github.com/zgsm-ai/codebase-indexer/internal/dao/model"
8-
"github.com/zgsm-ai/codebase-indexer/internal/tracer"
96
"sync"
107
"time"
118

12-
"github.com/zgsm-ai/codebase-indexer/internal/errs"
13-
"gorm.io/gorm"
9+
"github.com/zgsm-ai/codebase-indexer/internal/dao/model"
10+
"github.com/zgsm-ai/codebase-indexer/internal/tracer"
1411

1512
"github.com/zgsm-ai/codebase-indexer/internal/svc"
1613
"github.com/zgsm-ai/codebase-indexer/internal/types"
@@ -33,24 +30,14 @@ func NewSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SummaryLo
3330
}
3431

3532
func (l *SummaryLogic) Summary(req *types.IndexSummaryRequest) (*types.IndexSummaryResonseData, error) {
36-
clientId := req.ClientId
37-
clientPath := req.CodebasePath
3833

39-
// 查找代码库记录
40-
codebase, err := l.svcCtx.Querier.Codebase.FindByClientIdAndPath(l.ctx, clientId, clientPath)
41-
if errors.Is(err, gorm.ErrRecordNotFound) {
42-
return nil, errs.NewRecordNotFoundErr(types.NameCodeBase, fmt.Sprintf("client_id: %s, clientPath: %s", clientId, clientPath))
43-
}
44-
if err != nil {
45-
return nil, err
46-
}
47-
48-
ctx := context.WithValue(l.ctx, tracer.Key, tracer.RequestTraceId(int(codebase.ID)))
34+
ctx := context.WithValue(l.ctx, tracer.Key, req.ClientId)
4935

5036
var (
5137
wg sync.WaitGroup
5238
embeddingSummary *types.EmbeddingSummary
5339
embeddingIndexTask *model.IndexHistory
40+
embeddingErr error
5441
)
5542

5643
// 定义超时时间
@@ -64,38 +51,29 @@ func (l *SummaryLogic) Summary(req *types.IndexSummaryRequest) (*types.IndexSumm
6451
defer cancel() // 避免资源泄漏
6552

6653
var err error
67-
embeddingSummary, err = l.svcCtx.VectorStore.GetIndexSummary(timeoutCtx, codebase.ID, codebase.Path)
54+
embeddingSummary, err = l.svcCtx.VectorStore.GetIndexSummary(timeoutCtx, req.ClientId, req.CodebasePath)
6855
if err != nil {
69-
if errors.Is(ctx.Err(), context.DeadlineExceeded) {
70-
tracer.WithTrace(ctx).Errorf("embedding summary query timed out after %v", timeoutCtx)
56+
if errors.Is(timeoutCtx.Err(), context.DeadlineExceeded) {
57+
tracer.WithTrace(ctx).Errorf("embedding summary query timed out after %v", timeout)
58+
embeddingErr = errors.New("embedding summary query timed out")
7159
} else {
7260
tracer.WithTrace(ctx).Errorf("failed to get embedding summary, err:%v", err)
61+
embeddingErr = err
7362
}
7463
return
7564
}
7665
}()
7766

78-
// 获取最新的embedding索引任务(带超时控制)
79-
wg.Add(1)
80-
go func() {
81-
defer wg.Done()
82-
timeoutCtx, cancel := context.WithTimeout(ctx, timeout)
83-
defer cancel() // 避免资源泄漏
84-
embeddingIndexTask, err = l.svcCtx.Querier.IndexHistory.GetLatestTaskHistory(timeoutCtx, codebase.ID, types.TaskTypeEmbedding)
85-
if err != nil {
86-
if errors.Is(timeoutCtx.Err(), context.DeadlineExceeded) {
87-
tracer.WithTrace(timeoutCtx).Errorf("embedding index task query timed out after %v", timeout)
88-
} else {
89-
tracer.WithTrace(timeoutCtx).Errorf("failed to get latest embedding index task, err:%v", err)
90-
}
91-
}
92-
}()
93-
9467
// 等待所有协程完成
9568
wg.Wait()
9669

70+
// 检查是否有错误发生
71+
if embeddingErr != nil {
72+
return nil, embeddingErr
73+
}
74+
9775
resp := &types.IndexSummaryResonseData{
98-
TotalFiles: int(codebase.FileCount),
76+
TotalFiles: 0,
9977
Embedding: types.EmbeddingSummary{
10078
Status: types.TaskStatusPending,
10179
},
@@ -109,6 +87,7 @@ func (l *SummaryLogic) Summary(req *types.IndexSummaryRequest) (*types.IndexSumm
10987
}
11088

11189
if embeddingSummary != nil {
90+
resp.TotalFiles = embeddingSummary.TotalFiles
11291
resp.Embedding.TotalChunks = embeddingSummary.TotalChunks
11392
resp.Embedding.TotalFiles = embeddingSummary.TotalFiles
11493
}

internal/logic/update_embedding.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ func (l *UpdateEmbeddingLogic) UpdateEmbeddingPath(req *types.UpdateEmbeddingPat
3131
var modifiedFiles []string
3232

3333
// 处理目录情况,使用 UpdateCodeChunksDictionary 接口
34-
err = l.svcCtx.VectorStore.UpdateCodeChunksDictionary(l.ctx, codebasePath, oldPath, newPath)
34+
err = l.svcCtx.VectorStore.UpdateCodeChunksDictionary(l.ctx, req.ClientId, codebasePath, oldPath, newPath)
3535
if err != nil {
3636
return nil, fmt.Errorf("failed to update directory paths: %w", err)
3737
}
3838

3939
// 获取更新后的记录以返回修改的文件列表
40-
records, err := l.svcCtx.VectorStore.GetDictionaryRecords(l.ctx, codebasePath, newPath)
40+
records, err := l.svcCtx.VectorStore.GetDictionaryRecords(l.ctx, req.ClientId, codebasePath, newPath)
4141
if err != nil {
4242
return nil, fmt.Errorf("failed to get updated dictionary records: %w", err)
4343
}

internal/logic/vectors_summary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (l *VectorsSummaryLogic) VectorsSummary(req *types.GetAllVectorsSummaryRequ
6969
var embeddingIndexTask *model.IndexHistory
7070

7171
// 获取向量汇总信息
72-
embeddingSummary, err = l.svcCtx.VectorStore.GetIndexSummary(timeoutCtx, cb.ID, cb.Path)
72+
embeddingSummary, err = l.svcCtx.VectorStore.GetIndexSummary(timeoutCtx, cb.ClientID, cb.Path)
7373
if err != nil {
7474
if errors.Is(timeoutCtx.Err(), context.DeadlineExceeded) {
7575
tracer.WithTrace(ctx).Errorf("embedding summary query timed out after %v for codebase %d", timeout, cb.ID)

0 commit comments

Comments
 (0)