fix(bolt_store): use existing uploading info instead returing error

This commit is contained in:
hexxa 2022-03-05 17:18:53 +08:00 committed by Hexxa
parent 406f908d9e
commit 3c2cc79b05

View file

@ -100,11 +100,10 @@ func (bs *BoltStore) setUploadInfo(tx *bolt.Tx, userID uint64, uploadPath string
}
}
existingInfo := uploadInfoBucket.Get([]byte(uploadPath))
if existingInfo != nil && !overWrite {
return db.ErrCreateExisting
existingInfoBytes := uploadInfoBucket.Get([]byte(uploadPath))
if existingInfoBytes != nil {
return nil
}
uploadInfoBytes, err := json.Marshal(uploadInfo)
if err != nil {
return err