Feat: recycling file storage and user capacity when uploading canceled

This commit is contained in:
HFO4
2019-11-18 14:06:15 +08:00
parent 160f964564
commit 631c23f065
9 changed files with 93 additions and 14 deletions

View File

@@ -27,7 +27,7 @@ func (fs *FileSystem) ValidateFileSize(ctx context.Context, size uint64) bool {
// ValidateCapacity 验证并扣除用户容量
func (fs *FileSystem) ValidateCapacity(ctx context.Context, size uint64) bool {
if fs.User.DeductionCapacity(size) {
if fs.User.IncreaseStorage(size) {
return true
}
return false