test(files): add move folder test and clean code
This commit is contained in:
parent
17b4544487
commit
652adba4ad
6 changed files with 74 additions and 80 deletions
|
@ -160,7 +160,7 @@ func (bs *BoltStore) AddUploadInfos(userID uint64, tmpPath, filePath string, inf
|
|||
}
|
||||
|
||||
if userInfo.UsedSpace+info.Size > int64(userInfo.Quota.SpaceLimit) {
|
||||
return errors.New("space limit is reached")
|
||||
return db.ErrQuota
|
||||
}
|
||||
|
||||
// update used space
|
||||
|
@ -370,7 +370,6 @@ func (bs *BoltStore) MoveInfos(userID uint64, oldPath, newPath string, isDir boo
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Println("\n\n\n4", err)
|
||||
// add new info
|
||||
return bs.setFileInfo(tx, userID, newPath, fileInfo)
|
||||
})
|
||||
|
|
|
@ -21,6 +21,7 @@ var (
|
|||
ErrBucketNotFound = errors.New("bucket not found")
|
||||
ErrKeyNotFound = errors.New("key not found")
|
||||
ErrCreateExisting = errors.New("create upload info which already exists")
|
||||
ErrQuota = errors.New("quota limit reached")
|
||||
)
|
||||
|
||||
type FileInfo struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue