From 8cd1037759e97d4b7ab0e790709ec910b4fdbb84 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 1 Jan 2025 17:20:30 +0800 Subject: [PATCH] :bug: Fix analyze result did not applied --- pkg/internal/services/analyzer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/internal/services/analyzer.go b/pkg/internal/services/analyzer.go index 428f769..48359c6 100644 --- a/pkg/internal/services/analyzer.go +++ b/pkg/internal/services/analyzer.go @@ -220,7 +220,10 @@ func AnalyzeAttachment(file models.Attachment) error { tx := database.C.Begin() - if err := tx.Model(&file).Update("is_analyzed", true).Error; err != nil { + if err := tx.Model(&file).Updates(&models.Attachment{ + IsAnalyzed: true, + Metadata: file.Metadata, + }).Error; err != nil { tx.Rollback() return fmt.Errorf("unable to update file record: %v", err) }