fix(bolt_store): use existing uploading info instead returing error
This commit is contained in:
parent
406f908d9e
commit
3c2cc79b05
1 changed files with 3 additions and 4 deletions
|
@ -100,11 +100,10 @@ func (bs *BoltStore) setUploadInfo(tx *bolt.Tx, userID uint64, uploadPath string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
existingInfo := uploadInfoBucket.Get([]byte(uploadPath))
|
existingInfoBytes := uploadInfoBucket.Get([]byte(uploadPath))
|
||||||
if existingInfo != nil && !overWrite {
|
if existingInfoBytes != nil {
|
||||||
return db.ErrCreateExisting
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadInfoBytes, err := json.Marshal(uploadInfo)
|
uploadInfoBytes, err := json.Marshal(uploadInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue