🐛 Fix analyzer didn't cache attachment

This commit is contained in:
2024-08-21 10:51:11 +08:00
parent 479b1933b0
commit 1e4d7985ea
2 changed files with 4 additions and 8 deletions

View File

@ -181,7 +181,7 @@ func AnalyzeAttachment(file models.Attachment) error {
if linked && err != nil {
return fmt.Errorf("unable to link file record: %v", err)
} else if !linked {
metadataCache.Store(file.ID, file)
CacheAttachment(file)
if err := tx.Save(&file).Error; err != nil {
tx.Rollback()
return fmt.Errorf("unable to save file record: %v", err)