Skip to content

Commit ea232a5

Browse files
committed
fix status bug
1 parent a13ceeb commit ea232a5

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ main.exe
2929
bin/*
3030
.roo
3131
docs/task.md
32-
testfiles
33-
cmd.sh
32+
cmd.sh
33+
testfiles

deploy/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ data:
8888
max_concurrency: 5
8989
skip_patterns: []
9090
TokenLimit:
91-
max_running_tasks: 1
91+
max_running_tasks: 100
9292
enabled: true
9393
---
9494
apiVersion: apps/v1

internal/logic/embedding_task.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ func (l *TaskLogic) SubmitTask(req *types.IndexTaskRequest, r *http.Request) (re
173173
var fileStatusItems []types.FileStatusItem
174174

175175
// 添加任务
176-
for path, _ := range files {
177-
fileStatusItem := types.FileStatusItem{
178-
Path: path, // 使用当前处理的文件路径,而不是codebasePath
179-
Status: "processing",
180-
Operate: fileOperations[path],
181-
}
182-
fileStatusItems = append(fileStatusItems, fileStatusItem)
183-
}
176+
// for path, _ := range files {
177+
// fileStatusItem := types.FileStatusItem{
178+
// Path: path, // 使用当前处理的文件路径,而不是codebasePath
179+
// Status: "processing",
180+
// Operate: fileOperations[path],
181+
// }
182+
// fileStatusItems = append(fileStatusItems, fileStatusItem)
183+
// }
184184

185185
// 删除任务
186186
for path, op := range fileOperations {

internal/store/vector/embedder.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,31 +136,32 @@ func (e *customEmbedder) EmbedCodeChunks(ctx context.Context, chunks []*types.Co
136136
status.Process = "processing"
137137
status.TotalProgress = progress
138138

139-
tracer.WithTrace(ctx).Infof(" requestid %s ,finish before %v", e.requestId, status.FileList)
139+
// tracer.WithTrace(ctx).Infof(" requestid %s ,finish before %v", e.requestId, status.FileList)
140140

141141
// 将这批文件的状态添加到FileList中
142142
for _, filePath := range completedFiles {
143143
// 检查文件是否已在FileList中
144-
found := false
144+
// found := false
145145
for i, item := range status.FileList {
146146
if item.Path == filePath {
147147
// 更新现有文件状态
148148
status.FileList[i].Status = "completed"
149-
found = true
149+
// found = true
150150
break
151151
}
152152
}
153153
// 如果文件不在FileList中,则添加新项
154-
if !found {
155-
status.FileList = append(status.FileList, types.FileStatusItem{
156-
Path: filePath,
157-
Status: "completed",
158-
Operate: "add", // 默认操作类型为add
159-
})
160-
}
154+
// if !found {
155+
// tracer.WithTrace(ctx).Infof("not found in filePath: %v ,fileList %v", filePath, status.FileList)
156+
// status.FileList = append(status.FileList, types.FileStatusItem{
157+
// Path: filePath,
158+
// Status: "completed",
159+
// Operate: "add", // 默认操作类型为add
160+
// })
161+
// }
161162
}
162163

163-
tracer.WithTrace(ctx).Infof(" requestid %s ,finish %v", e.requestId, status.FileList)
164+
// tracer.WithTrace(ctx).Infof(" requestid %s ,finish %v", e.requestId, status.FileList)
164165

165166
})
166167
if err != nil {

0 commit comments

Comments
 (0)