Change update attachment policy to prevent conflict with analyzer

This commit is contained in:
2024-07-29 21:11:42 +08:00
parent 36c814e1dc
commit 8196aac3de
2 changed files with 4 additions and 6 deletions

View File

@ -113,7 +113,7 @@ func TryLinkAttachment(tx *gorm.DB, og models.Attachment, hash string) (bool, er
}
func UpdateAttachment(item models.Attachment) (models.Attachment, error) {
if err := database.C.Save(&item).Error; err != nil {
if err := database.C.Updates(&item).Error; err != nil {
return item, err
} else {
MaintainAttachmentCache()