Fix the RandString method cause the lag

This commit is contained in:
2024-08-18 17:16:14 +08:00
parent f32803acf4
commit e7f6637398
4 changed files with 40 additions and 57 deletions

View File

@@ -60,8 +60,8 @@ func CacheAttachment(id uint, item models.Attachment) {
}
func NewAttachmentMetadata(tx *gorm.DB, user models.Account, file *multipart.FileHeader, attachment models.Attachment) (models.Attachment, error) {
attachment.Rid = RandString(16)
attachment.Uuid = uuid.NewString()
attachment.Rid = RandString(16)
attachment.Size = file.Size
attachment.Name = file.Filename
attachment.AccountID = user.ID