Skip to content

Commit 53652c5

Browse files
author
9593
committed
update code
1 parent 9f15704 commit 53652c5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

agent-as-a-service/agent-orchestration/backend/internal/usecase/knowledge/knowledge_usecase.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,13 @@ func (uc *knowledgeUsecase) uploadKBFileToLighthouseAndProcess(ctx context.Conte
612612

613613
result := []*lighthouse.FileInLightHouse{}
614614
for _, f := range kn.KnowledgeBaseFiles {
615-
if f.FilecoinHashRawData != "" {
616-
r := &lighthouse.FileInLightHouse{}
617-
if err := json.Unmarshal([]byte(f.FilecoinHashRawData), r); err == nil {
618-
result = append(result, r)
619-
continue
620-
}
615+
if f.FilecoinHashRawData != "" && f.Status == models.KnowledgeBaseFileStatusDone {
616+
continue
617+
// r := &lighthouse.FileInLightHouse{}
618+
// if err := json.Unmarshal([]byte(f.FilecoinHashRawData), r); err == nil {
619+
// result = append(result, r)
620+
// continue
621+
// }
621622
}
622623

623624
r, err := lighthouse.ZipAndUploadFileInMultiplePartsToLightHouseByUrl(f.FileUrl, "/tmp/data", uc.lighthouseKey)

0 commit comments

Comments
 (0)